all repos — fluxbox @ 2e75d238abe6742bfa0f97b9669aa7bc6fa65759

custom fork of the fluxbox windowmanager

add FbTk::makeRef function, for easier construction of RefCount pointers
Pavel Labath pavelo@centrum.sk
commit

2e75d238abe6742bfa0f97b9669aa7bc6fa65759

parent

cfcc4d44aa07c0e33ee299e38c94e3f7f6c0458e

1 files changed, 20 insertions(+), 0 deletions(-)

jump to
M src/FbTk/RefCount.hhsrc/FbTk/RefCount.hh

@@ -134,6 +134,26 @@ return;

(*m_refcount)++; } +template <typename Pointer> +inline RefCount<Pointer> makeRef() { + return RefCount<Pointer>(new Pointer); +} + +template <typename Pointer, typename Arg1> +inline RefCount<Pointer> makeRef(const Arg1 &arg1) { + return RefCount<Pointer>(new Pointer(arg1)); +} + +template <typename Pointer, typename Arg1, typename Arg2> +inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2) { + return RefCount<Pointer>(new Pointer(arg1, arg2)); +} + +template <typename Pointer, typename Arg1, typename Arg2, typename Arg3> +inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) { + return RefCount<Pointer>(new Pointer(arg1, arg2, arg3)); +} + } // end namespace FbTk #endif // FBTK_REFCOUNT_HH