summaryrefslogtreecommitdiff
path: root/boost/log/detail/attachable_sstream_buf.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/log/detail/attachable_sstream_buf.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/log/detail/attachable_sstream_buf.hpp')
-rw-r--r--boost/log/detail/attachable_sstream_buf.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/boost/log/detail/attachable_sstream_buf.hpp b/boost/log/detail/attachable_sstream_buf.hpp
index 7bcb3a4307..e196689c80 100644
--- a/boost/log/detail/attachable_sstream_buf.hpp
+++ b/boost/log/detail/attachable_sstream_buf.hpp
@@ -22,7 +22,7 @@
#include <string>
#include <streambuf>
#include <boost/assert.hpp>
-#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#include <boost/locale/utf.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/header.hpp>
@@ -277,11 +277,13 @@ protected:
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
size_type length_until_boundary(const char_type* s, size_type n, size_type max_size) const
{
- return length_until_boundary(s, n, max_size, mpl::bool_< sizeof(char_type) == 1u >());
+ BOOST_ASSERT(max_size <= n);
+ return length_until_boundary(s, n, max_size, boost::integral_constant< bool, sizeof(char_type) == 1u >());
}
+private:
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
- size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, mpl::true_) const
+ size_type length_until_boundary(const char_type* s, size_type, size_type max_size, boost::true_type) const
{
std::locale loc = this->getloc();
std::codecvt< wchar_t, char, std::mbstate_t > const& fac = std::use_facet< std::codecvt< wchar_t, char, std::mbstate_t > >(loc);
@@ -290,7 +292,7 @@ protected:
}
//! Finds the string length so that it includes only complete characters, and does not exceed \a max_size
- static size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, mpl::false_)
+ static size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, boost::false_type)
{
// Note: Although it's not required to be true for wchar_t, here we assume that the string has Unicode encoding.
// Compilers use some version of Unicode for wchar_t on all tested platforms, and std::locale doesn't offer a way