// Copyright Antony Polukhin, 2012-2025. // // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). #include #include #include #include #include #include template struct is_optimized_stream : boost::false_type {}; template struct is_optimized_stream< boost::detail::lcast::optimized_src_stream > : boost::true_type {}; template static void assert_optimized_stream() { BOOST_TEST((is_optimized_stream< typename boost::detail::lexical_converter_impl::from_src_stream >::value)); } template static void test_optimized_types_to_string_const() { namespace de = boost::detail; typedef de::lexical_cast_stream_traits trait_1; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); assert_optimized_stream(); assert_optimized_stream(); typedef de::lexical_cast_stream_traits trait_2; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); typedef de::lexical_cast_stream_traits trait_3; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); assert_optimized_stream(); assert_optimized_stream(); } template static void test_optimized_types_to_string() { test_optimized_types_to_string_const(); namespace de = boost::detail; typedef de::lexical_cast_stream_traits trait_4; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); assert_optimized_stream(); typedef de::lexical_cast_stream_traits trait_5; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); typedef de::lexical_cast_stream_traits trait_6; BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); BOOST_TEST((boost::is_same::value)); } template static void test_optimized_types_to_x_string() { test_optimized_types_to_string(); assert_optimized_stream(); assert_optimized_stream(); } template static void test_optimized_types_to_wstring() { assert_optimized_stream(); assert_optimized_stream(); assert_optimized_stream(); assert_optimized_stream(); } void test_metafunctions() { test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); #if defined(BOOST_HAS_LONG_LONG) test_optimized_types_to_x_string(); test_optimized_types_to_x_string(); #elif defined(BOOST_HAS_MS_INT64) test_optimized_types_to_x_string(); test_optimized_types_to_x_string<__int64>(); #endif test_optimized_types_to_string(); test_optimized_types_to_string(); test_optimized_types_to_string(); test_optimized_types_to_string(); test_optimized_types_to_string(); //test_optimized_types_to_string(); //test_optimized_types_to_string(); test_optimized_types_to_string(); //test_optimized_types_to_string(); //test_optimized_types_to_string(); test_optimized_types_to_string(); //test_optimized_types_to_string(); //test_optimized_types_to_string(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); #ifndef BOOST_NO_CXX11_HDR_ARRAY test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_string_const >(); test_optimized_types_to_wstring>(); test_optimized_types_to_wstring>(); #endif test_optimized_types_to_wstring(); test_optimized_types_to_wstring(); test_optimized_types_to_wstring>(); test_optimized_types_to_wstring>(); test_optimized_types_to_string(); test_optimized_types_to_wstring>(); #ifndef BOOST_NO_CXX17_HDR_STRING_VIEW test_optimized_types_to_string(); test_optimized_types_to_wstring>(); #endif } int main() { test_metafunctions(); return boost::report_errors(); }