Convert Reference
algorithm_helperwith_fallbackFallbackType const &TypeOutTypeIn const &Converter const &TypeInConverterboost::convert< TypeOut >::algorithm_helper< TypeIn, Converter >::with_fallbackboost::convert< TypeOut >::algorithm_helper< TypeIn, Converter >out_typebase_type const &TypeOut const &TypeOutTypeIn const &resultboost::safebool< result >booltypename safebool::typeout_type const &out_typeFallbackType const &out_type const &this_type &boolboost::convert< TypeOut >unspecifiedthis_type::resultstatic out_typestatic result_typeTypeIn const &Converter const &static algorithm_helper< TypeIn, Converter >Converter const &
boolTypeIn const &TypeOut &
Generalization of the Safe-Bool Technique. An implicit conversion to bool (operator bool() const) is very much idiomatic and is often deployed in constructs like "if (foo)" and "if (!foo)" (with no explicit op!() defined). However, sadly, implementing "operator bool()" is *wrong* as that conversion kicks in far too often and unexpectedly. Like in "foo == 1", "foo+1", "1+foo" or potentially during lexical_cast<string>(foo) (if there are no op>>() and op<<() defined). Consequently, that "implicit conversion to bool" functionality has to be implemented in an indirect and somewhat awkward way via an implicit conversion to some other type. The best type for the purpose appears to be a pointer to a member function. For more see the chapter 7.7 in Alexandrescu's "Modern C++ Design" and the article at http://www.artima.com/cppsource/safebool.html by Bjorn Karlsson. Deployment: struct Foo { ... operator safebool<Foo>::type() const { return safebool<Foo>(condition); } }; template<class T> struct Zoo // for a template class { ... operator typename safebool<Zoo>::type() const { return safebool<Zoo>(condition); } }; template<class T> struct Zoo // with convenience typedefs { ... typedef safebool<Zoo> safebool; typedef typename safebool::type safebool_type; operator safebool_type() const { return safebool(condition); } }; safebool needs to be a template to make the returned safebool<Foo>::type unique. Without it different classes would return the same safebool::type that would make possible relational operators between unrelated types. Like struct Foo { operator safebool::type() const { return safebool(...); }}; struct Zoo { operator safebool::type() const { return safebool(...); }}; Foo foo; Zoo zoo; if (foo == zoo) Valid (but wrong) comparison between unrelated types. void(safebool::*typeboolboolvoid
Charbasic_stringstream_converterstd::basic_stringstream< char_type >std::ios_base &(*unspecifiedTypeIn const &StringOut &unspecifiedStringIn const &TypeOut &unspecifiedStringIn const &StringOut &this_type &std::locale const &this_type &manipulator_typethis_type &Manipulatorbasic_stringstream_converter< char >basic_stringstream_converter< wchar_t >
Defines various string-related type checks