1 // Copyright (C) 2003, Fernando Luis Cacciola Carballal.
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
10 // NOTE: This file is intended to be used ONLY by the test files
11 // from the Numeric Conversions Library
15 // The following 'to_string' helpers are provided to give readable names
16 // to the various enums used by the library.
17 // NOTE: specializations of boost::lexical_cast<> were not used since some compilers had
18 // trouble dealing with such specializations for different enumerations.
21 std::string
to_string ( boost::numeric::int_float_mixture_enum arg
)
25 case boost::numeric::integral_to_integral
: return "integral_to_integral" ;
26 case boost::numeric::integral_to_float
: return "integral_to_float" ;
27 case boost::numeric::float_to_integral
: return "float_to_integral" ;
28 case boost::numeric::float_to_float
: return "float_to_float" ;
30 return "(Unknown result!)" ;
34 std::string
to_string ( boost::numeric::sign_mixture_enum arg
)
38 case boost::numeric::unsigned_to_unsigned
: return "unsigned_to_unsigned" ;
39 case boost::numeric::signed_to_signed
: return "signed_to_signed" ;
40 case boost::numeric::signed_to_unsigned
: return "signed_to_unsigned" ;
41 case boost::numeric::unsigned_to_signed
: return "unsigned_to_signed" ;
43 return "(Unknown result!)" ;
46 std::string
to_string ( boost::numeric::udt_builtin_mixture_enum arg
)
50 case boost::numeric::builtin_to_builtin
: return "builtin_to_builtin" ;
51 case boost::numeric::builtin_to_udt
: return "builtin_to_udt" ;
52 case boost::numeric::udt_to_builtin
: return "udt_to_builtin" ;
53 case boost::numeric::udt_to_udt
: return "udt_to_udt" ;
55 return "(Unknown result!)" ;
59 ///////////////////////////////////////////////////////////////////////////////////////////////