diff options
Diffstat (limited to 'libs/lua/LuaBridge/detail/TypeList.h')
-rw-r--r-- | libs/lua/LuaBridge/detail/TypeList.h | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/libs/lua/LuaBridge/detail/TypeList.h b/libs/lua/LuaBridge/detail/TypeList.h index 52284a4adf..07571325c8 100644 --- a/libs/lua/LuaBridge/detail/TypeList.h +++ b/libs/lua/LuaBridge/detail/TypeList.h @@ -67,6 +67,14 @@ struct TypeListValues /** TypeListValues recursive template definition. + + Note that for references and const references, + this template will not copy-construct the object. + + Special cases were intentionally removed in 6dc3bdf, becuase + we cannot simply copy-constructing Ardour Session Objects. + Lifetime is generally C++/boost managed and will + stay around for th lifetime of the TypeList. */ template <typename Head, typename Tail> struct TypeListValues <TypeList <Head, Tail> > @@ -92,58 +100,6 @@ struct TypeListValues <TypeList <Head, Tail> > } }; -// Specializations of type/value list for head types that are references and -// const-references. We need to handle these specially since we can't count -// on the referenced object hanging around for the lifetime of the list. - -template <typename Head, typename Tail> -struct TypeListValues <TypeList <Head&, Tail> > -{ - Head& hd; - TypeListValues <Tail> tl; - - TypeListValues (Head& hd_, TypeListValues <Tail> const& tl_) - : hd (hd_), tl (tl_) - { - } - - static std::string const tostring (bool comma = false) - { - std::string s; - - if (comma) - s = ", "; - - s = s + typeid (Head).name () + "&"; - - return s + TypeListValues <Tail>::tostring (true); - } -}; - -template <typename Head, typename Tail> -struct TypeListValues <TypeList <Head const&, Tail> > -{ - const Head& hd; - TypeListValues <Tail> tl; - - TypeListValues (Head const& hd_, const TypeListValues <Tail>& tl_) - : hd (hd_), tl (tl_) - { - } - - static std::string const tostring (bool comma = false) - { - std::string s; - - if (comma) - s = ", "; - - s = s + typeid (Head).name () + " const&"; - - return s + TypeListValues <Tail>::tostring (true); - } -}; - //============================================================================== /** Subclass of a TypeListValues constructable from the Lua stack. |