summaryrefslogtreecommitdiff
path: root/boost/detail
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:45:20 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:46:37 +0900
commit733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /boost/detail
parent08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff)
downloadboost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/detail')
-rw-r--r--boost/detail/indirect_traits.hpp1
-rw-r--r--boost/detail/is_incrementable.hpp2
-rw-r--r--boost/detail/lightweight_test_report.hpp56
-rw-r--r--boost/detail/utf8_codecvt_facet.hpp51
-rw-r--r--boost/detail/utf8_codecvt_facet.ipp9
5 files changed, 98 insertions, 21 deletions
diff --git a/boost/detail/indirect_traits.hpp b/boost/detail/indirect_traits.hpp
index 7c8f76b09d..6294e40f6a 100644
--- a/boost/detail/indirect_traits.hpp
+++ b/boost/detail/indirect_traits.hpp
@@ -16,7 +16,6 @@
# include <boost/type_traits/remove_reference.hpp>
# include <boost/type_traits/remove_pointer.hpp>
-# include <boost/type_traits/detail/ice_and.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/mpl/eval_if.hpp>
diff --git a/boost/detail/is_incrementable.hpp b/boost/detail/is_incrementable.hpp
index 6b36378fa2..88ddb14513 100644
--- a/boost/detail/is_incrementable.hpp
+++ b/boost/detail/is_incrementable.hpp
@@ -115,7 +115,7 @@ BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
template<typename T>
struct is_postfix_incrementable
-BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
+BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::postfix_impl<T>::value)
{
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
diff --git a/boost/detail/lightweight_test_report.hpp b/boost/detail/lightweight_test_report.hpp
new file mode 100644
index 0000000000..1511ba9d14
--- /dev/null
+++ b/boost/detail/lightweight_test_report.hpp
@@ -0,0 +1,56 @@
+// boost/detail/lightweight_test_reporter.hpp ----------------------------------------//
+
+// Copyright Beman Dawes 2014
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+//--------------------------------------------------------------------------------------//
+// //
+// Configuration reporting cpp_main() //
+// //
+// Displays configuration information, then returns test_main(argc, argv), which //
+// must be supplied by the user. //
+// //
+// Note: cpp_main(argc, argv) is called from a try block in main(), which is //
+// supplied by <boost/detail/lightweight_main.hpp> as is a catch block that reports //
+// std::exception what(). //
+// //
+//--------------------------------------------------------------------------------------//
+
+#include <boost/config.hpp>
+#include <boost/version.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/detail/lightweight_main.hpp>
+#include <iostream>
+
+int test_main(int argc, char* argv[]);
+
+int cpp_main(int argc, char* argv[])
+{
+ std::cout << BOOST_COMPILER
+#ifdef __GNUC__
+ << ", __GXX_EXPERIMENTAL_CXX0X__ "
+# ifdef __GXX_EXPERIMENTAL_CXX0X__
+ "defined"
+# else
+ "not defined"
+# endif
+#endif
+ << "\n"
+ << BOOST_STDLIB << "\n"
+ << BOOST_PLATFORM << "\n"
+ << "Boost version " << BOOST_VERSION / 100000 << '.'
+ << BOOST_VERSION / 100 % 1000 << '.' << BOOST_VERSION % 100 << "\n";
+
+ std::cout << "Command line: ";
+ for (int a = 0; a < argc; ++a)
+ {
+ std::cout << argv[a];
+ if (a != argc - 1)
+ std::cout << ' ';
+ }
+ std::cout << std::endl;
+
+ return test_main(argc, argv);
+} \ No newline at end of file
diff --git a/boost/detail/utf8_codecvt_facet.hpp b/boost/detail/utf8_codecvt_facet.hpp
index 753b339336..2d7ed8b2c4 100644
--- a/boost/detail/utf8_codecvt_facet.hpp
+++ b/boost/detail/utf8_codecvt_facet.hpp
@@ -14,7 +14,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// utf8_codecvt_facet.hpp
-// This header defines class utf8_codecvt_facet, derived fro
+// This header defines class utf8_codecvt_facet, derived from
// std::codecvt<wchar_t, char>, which can be used to convert utf8 data in
// files into wchar_t strings in the application.
//
@@ -28,12 +28,13 @@
// This seems inconvenient, and asking a user to link to an unrevieved
// library is strange.
// Until the above points are fixed, a library which wants to use utf8 must:
-// - include this header from one of it's headers or sources
-// - include the corresponding .cpp file from one of the sources
+// - include this header in one of it's headers or sources
+// - include the corresponding boost/detail/utf8_codecvt_facet.ipp file in one
+// of its sources
// - before including either file, the library must define
// - BOOST_UTF8_BEGIN_NAMESPACE to the namespace declaration that must be used
// - BOOST_UTF8_END_NAMESPACE to the code to close the previous namespace
-// - declaration.
+// declaration.
// - BOOST_UTF8_DECL -- to the code which must be used for all 'exportable'
// symbols.
//
@@ -42,7 +43,7 @@
// namespace boost { namespace program_options {
// #define BOOST_UTF8_END_NAMESPACE }}
// #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL
-// #include "../../detail/utf8/utf8_codecvt.cpp"
+// #include <boost/detail/utf8_codecvt_facet.ipp>
//
// Essentially, each library will have its own copy of utf8 code, in
// different namespaces.
@@ -92,17 +93,19 @@ namespace std {
}
#endif
-#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
- #define BOOST_CODECVT_DO_LENGTH_CONST const
-#else
- #define BOOST_CODECVT_DO_LENGTH_CONST
-#endif
-
// maximum lenght of a multibyte string
#define MB_LENGTH_MAX 8
BOOST_UTF8_BEGIN_NAMESPACE
+//----------------------------------------------------------------------------//
+// //
+// utf8_codecvt_facet //
+// //
+// See utf8_codecvt_facet.ipp for the implementation. //
+//----------------------------------------------------------------------------//
+
+
struct BOOST_UTF8_DECL utf8_codecvt_facet :
public std::codecvt<wchar_t, char, std::mbstate_t>
{
@@ -174,12 +177,32 @@ protected:
// How many char objects can I process to get <= max_limit
// wchar_t objects?
virtual int do_length(
- BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
+ const std::mbstate_t &,
const char * from,
const char * from_end,
std::size_t max_limit
- ) const;
-
+ ) const
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+ throw()
+#endif
+ ;
+ virtual int do_length(
+ std::mbstate_t & s,
+ const char * from,
+ const char * from_end,
+ std::size_t max_limit
+ ) const
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+ throw()
+#endif
+ {
+ return do_length(
+ const_cast<const std::mbstate_t &>(s),
+ from,
+ from_end,
+ max_limit
+ );
+ }
// Largest possible value do_length(state,from,from_end,1) could return.
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
return 6; // largest UTF-8 encoding of a UCS-4 character
diff --git a/boost/detail/utf8_codecvt_facet.ipp b/boost/detail/utf8_codecvt_facet.ipp
index 8a13124657..d39170fdab 100644
--- a/boost/detail/utf8_codecvt_facet.ipp
+++ b/boost/detail/utf8_codecvt_facet.ipp
@@ -216,9 +216,9 @@ unsigned int utf8_codecvt_facet::get_octet_count(
else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
else return 6;
}
-BOOST_UTF8_END_NAMESPACE
-namespace {
+namespace detail {
+
template<std::size_t s>
int get_cont_octet_out_count_impl(wchar_t word){
if (word < 0x80) {
@@ -269,15 +269,14 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
#endif
}
-} // namespace anonymous
+} // namespace detail
-BOOST_UTF8_BEGIN_NAMESPACE
// How many "continuing octets" will be needed for this word
// == total octets - 1.
int utf8_codecvt_facet::get_cont_octet_out_count(
wchar_t word
) const {
- return get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
+ return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
}
BOOST_UTF8_END_NAMESPACE