...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::cnv::cnvbase
// In header: <boost/convert/base.hpp> template<typename derived_type> struct cnvbase { // types typedef cnvbase this_type; typedef int int_type; typedef unsigned int uint_type; typedef long int lint_type; typedef unsigned long int ulint_type; typedef short int sint_type; typedef unsigned short int usint_type; typedef long long int llint_type; typedef unsigned long long int ullint_type; typedef float flt_type; typedef double dbl_type; typedef long double ldbl_type; // construct/copy/destruct cnvbase(); // public member functions template<typename type_in, typename type_out> void operator()(type_in const &, boost::optional< type_out > &) const; BOOST_CNV_TO_STRING(int_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(uint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(lint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(llint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(ulint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(ullint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(sint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(usint_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(flt_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(dbl_type, optional< string_type > &) const; BOOST_CNV_TO_STRING(ldbl_type, optional< string_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< int_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< uint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< lint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< llint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< ulint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< ullint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< sint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< usint_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< flt_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< dbl_type > &) const; BOOST_CNV_STRING_TO(string_type const &, optional< ldbl_type > &) const; BOOST_CNV_PARAM(base, cnv::base); BOOST_CNV_PARAM(adjust, cnv::adjust); BOOST_CNV_PARAM(precision, int); BOOST_CNV_PARAM(uppercase, bool); BOOST_CNV_PARAM(skipws, bool); BOOST_CNV_PARAM(width, int); BOOST_CNV_PARAM(fill, char); // protected member functions template<typename string_type, typename out_type> void str_to_(string_type const &, optional< out_type > &) const; template<typename in_type, typename string_type> void to_str_(in_type, optional< string_type > &) const; derived_type const & dncast() const; derived_type & dncast(); };
cnvbase
public member functionstemplate<typename type_in, typename type_out> void operator()(type_in const & in, boost::optional< type_out > & out) const;
BOOST_CNV_TO_STRING(int_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(uint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(lint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(llint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(ulint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(ullint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(sint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(usint_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(flt_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(dbl_type v, optional< string_type > & r) const;
BOOST_CNV_TO_STRING(ldbl_type v, optional< string_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< int_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< uint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< lint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< llint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< ulint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< ullint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< sint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< usint_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< flt_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< dbl_type > & r) const;
BOOST_CNV_STRING_TO(string_type const & s, optional< ldbl_type > & r) const;
BOOST_CNV_PARAM(base, cnv::base);
BOOST_CNV_PARAM(adjust, cnv::adjust);
BOOST_CNV_PARAM(precision, int);
BOOST_CNV_PARAM(uppercase, bool);
BOOST_CNV_PARAM(skipws, bool);
BOOST_CNV_PARAM(width, int);
BOOST_CNV_PARAM(fill, char);
cnvbase
protected member functionstemplate<typename string_type, typename out_type> void str_to_(string_type const & str, optional< out_type > & result_out) const;
template<typename in_type, typename string_type> void to_str_(in_type value_in, optional< string_type > & result_out) const;
derived_type const & dncast() const;
derived_type & dncast();