Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / lexical_cast / test / lexical_cast_typedefed_wchar_test.cpp
1 //  Unit test for boost::lexical_cast.
2 //
3 //  See http://www.boost.org for most recent version, including documentation.
4 //
5 //  Copyright Antony Polukhin, 2011.
6 //
7 //  Distributed under the Boost
8 //  Software License, Version 1.0. (See accompanying file
9 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).
10
11 #include <boost/config.hpp>
12
13 #include <boost/static_assert.hpp>
14 #include <boost/lexical_cast.hpp>
15
16 #include <boost/date_time/gregorian/gregorian.hpp>
17 #include <boost/date_time/posix_time/posix_time.hpp>
18
19 void parseDate()
20 {
21   std::locale locale;
22   boost::date_time::format_date_parser<boost::gregorian::date, wchar_t> parser(L"", locale);
23   boost::date_time::special_values_parser<boost::gregorian::date, wchar_t> svp;
24
25   boost::gregorian::date date = parser.parse_date(L"", L"", svp);
26   (void)date;
27 }
28
29
30 int main()
31 {
32 #ifdef BOOST_MSVC
33     BOOST_STATIC_ASSERT((boost::is_same<wchar_t, unsigned short>::value));
34 #endif
35
36     parseDate();
37     return ::boost::lexical_cast<int>(L"1000") == 1000;
38 }
39
40