Trying to fix ambiguities of operator<<() for unused_type.

[SVN r52511]
This commit is contained in:
Hartmut Kaiser
2009-04-20 14:57:57 +00:00
parent 9acd9b2feb
commit e1ac68f526

View File

@ -15,7 +15,7 @@
#define BOOST_FUSION_UNUSED_HAS_IO #define BOOST_FUSION_UNUSED_HAS_IO
namespace fusion_adl_barrier namespace boost { namespace fusion
{ {
struct unused_type struct unused_type
{ {
@ -56,23 +56,25 @@ namespace fusion_adl_barrier
}; };
unused_type const unused = unused_type(); unused_type const unused = unused_type();
}
namespace boost { namespace fusion namespace detail
{ {
using ::fusion_adl_barrier::unused_type; struct unused_only
using ::fusion_adl_barrier::unused; {
unused_only(unused_type const&) {}
};
}
template <typename Out> template <typename Out>
inline Out& operator<<(Out& out, unused_type const&) inline Out& operator<<(Out& out, detail::unused_only const&)
{ {
return out; return out;
} }
template <typename Out> template <typename In>
inline Out& operator>>(Out& out, unused_type&) inline In& operator>>(In& in, unused_type&)
{ {
return out; return in;
} }
}} }}