Index: boost/blank.hpp =================================================================== --- boost/blank.hpp (revision 53367) +++ boost/blank.hpp (working copy) @@ -15,9 +15,11 @@ #include "boost/blank_fwd.hpp" +#if !defined(BOOST_NO_IOSTREAM) #include // for std::basic_ostream forward declare +#include "boost/detail/templated_streams.hpp" +#endif // BOOST_NO_IOSTREAM -#include "boost/detail/templated_streams.hpp" #include "boost/mpl/bool.hpp" #include "boost/type_traits/is_empty.hpp" #include "boost/type_traits/is_pod.hpp" @@ -85,6 +87,8 @@ // streaming support // +#if !defined(BOOST_NO_IOSTREAM) + BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( BOOST_TEMPLATED_STREAM(ostream, E,T)& out @@ -95,6 +99,8 @@ return out; } +#endif // BOOST_NO_IOSTREAM + } // namespace boost #endif // BOOST_BLANK_HPP Index: boost/variant/variant.hpp =================================================================== --- boost/variant/variant.hpp (revision 53367) +++ boost/variant/variant.hpp (working copy) @@ -15,7 +15,10 @@ #include // for std::size_t #include // for placement new + +#if !defined(BOOST_NO_TYPEID) #include // for typeid, std::type_info +#endif // BOOST_NO_TYPEID #include "boost/variant/detail/config.hpp" #include "boost/mpl/aux_/config/eti.hpp" @@ -691,6 +694,9 @@ // // Generic static visitor that performs a typeid on the value it visits. // + +#if !defined(BOOST_NO_TYPEID) + class reflect : public static_visitor { @@ -704,6 +710,8 @@ }; +#endif // BOOST_NO_TYPEID + /////////////////////////////////////////////////////////////////////////////// // (detail) class comparer // @@ -1627,11 +1635,13 @@ return false; } +#if !defined(BOOST_NO_TYPEID) const std::type_info& type() const { detail::variant::reflect visitor; return this->apply_visitor(visitor); } +#endif public: // prevent comparison with foreign types @@ -1823,6 +1833,9 @@ } // namespace boost // implementation additions + +#if !defined(BOOST_NO_IOSTREAM) #include "boost/variant/detail/variant_io.hpp" +#endif // BOOST_NO_IOSTREAM #endif // BOOST_VARIANT_VARIANT_HPP Index: libs/variant/test/jobs.h =================================================================== --- libs/variant/test/jobs.h (revision 53367) +++ libs/variant/test/jobs.h (working copy) @@ -232,29 +232,28 @@ +// This is not used and breaks when BOOST_NO_TYPEID is defined +//struct held_type_name : boost::static_visitor +//{ +// +// template +// std::string operator()(const T& ) const +// { +// ost_ << '[' << typeid(T).name() << ']'; +// return result(); +// } +// +// std::string result() const +// { +// return ost_.str(); +// } +// +// mutable std::ostringstream ost_; +// +//}; //held_type_name -struct held_type_name : boost::static_visitor -{ - - template - std::string operator()(const T& ) const - { - ost_ << '[' << typeid(T).name() << ']'; - return result(); - } - std::string result() const - { - return ost_.str(); - } - mutable std::ostringstream ost_; - -}; //held_type_name - - - - template struct spec { @@ -267,7 +266,9 @@ const VariantType& cvar = var; BOOST_CHECK(boost::apply_visitor(total_sizeof(), cvar) == sizeof(S)); +#if !defined(BOOST_NO_TYPEID) BOOST_CHECK(cvar.type() == typeid(S)); +#endif // // Check get<>() @@ -316,7 +317,9 @@ { const VariantType& cvar = var; +#if !defined(BOOST_NO_TYPEID) BOOST_CHECK(cvar.type() != typeid(S)); +#endif // // Check get<>() Index: libs/variant/test/test3.cpp =================================================================== --- libs/variant/test/test3.cpp (revision 53367) +++ libs/variant/test/test3.cpp (working copy) @@ -122,7 +122,9 @@ std::ostringstream e1_str; e1_str << e1; +#if !defined(BOOST_NO_TYPEID) BOOST_CHECK(e1.type() == typeid(Add)); +#endif BOOST_CHECK(e1_str.str() == "(13+((40+2)-(10+4)))"); //Evaluate expression Index: libs/variant/doc/reference/variant.xml =================================================================== --- libs/variant/doc/reference/variant.xml (revision 53367) +++ libs/variant/doc/reference/variant.xml (working copy) @@ -364,6 +364,11 @@ Will not throw. + + + Not available when BOOST_NO_TYPEID is + defined. + @@ -536,6 +541,12 @@ Calls out << x, where x is the content of rhs. + + + Not available when BOOST_NO_IOSTREAM is + defined. + +