diff options
| author | frsyuki <frsyuki@users.sourceforge.jp> | 2009-08-07 13:31:42 +0900 |
|---|---|---|
| committer | frsyuki <frsyuki@users.sourceforge.jp> | 2009-08-07 13:31:42 +0900 |
| commit | be32e3b1fb3fc45747c8df13f9a2eed5626e7c47 (patch) | |
| tree | c488e0ba31d82cd43046ee8879e1d9cd530cec9f /cpp | |
| parent | b4cb5e23c0a235d61d4a63acf4624f96f20f620b (diff) | |
| download | msgpack-python-be32e3b1fb3fc45747c8df13f9a2eed5626e7c47.tar.gz | |
cpp: add missing msgpack::type::make_tuple()
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/type/tuple.hpp.erb | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/cpp/type/tuple.hpp.erb b/cpp/type/tuple.hpp.erb index 0105feb..d8ddbcd 100644 --- a/cpp/type/tuple.hpp.erb +++ b/cpp/type/tuple.hpp.erb @@ -64,7 +64,6 @@ struct tuple_type<const T&> { typedef const T& transparent_reference; }; - <%0.upto(GENERATION_LIMIT) {|i|%> <%0.upto(i) {|j|%> template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>> @@ -78,7 +77,6 @@ private: <%}%> <%}%> - <%0.upto(GENERATION_LIMIT) {|i|%> <%0.upto(i) {|j|%> template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>> @@ -91,16 +89,6 @@ private: <%}%> <%}%> - -<%0.upto(GENERATION_LIMIT) {|i|%> -template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>> -tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>) -{ - return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>); -} -<%}%> - - template <> struct tuple<> { typedef tuple<> value_type; @@ -122,6 +110,18 @@ struct tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> { }; <%}%> +inline tuple<> make_tuple() +{ + return tuple<>(); +} +<%0.upto(GENERATION_LIMIT) {|i|%> +template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>> +tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>) +{ + return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>); +} +<%}%> + } // namespace type @@ -144,7 +144,6 @@ type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& operator>> ( } <%}%> - template <typename Stream> const packer<Stream>& operator<< ( packer<Stream>& o, @@ -164,7 +163,6 @@ const packer<Stream>& operator<< ( } <%}%> - } // namespace msgpack #endif /* msgpack/type/tuple.hpp */ |
