summaryrefslogtreecommitdiff
path: root/libs/lexical_cast
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 /libs/lexical_cast
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 'libs/lexical_cast')
-rw-r--r--libs/lexical_cast/README.md16
-rw-r--r--libs/lexical_cast/example/small_examples.cpp2
-rw-r--r--libs/lexical_cast/test/lexical_cast_integral_types_test.cpp6
-rw-r--r--libs/lexical_cast/test/lexical_cast_stream_traits_test.cpp8
-rw-r--r--libs/lexical_cast/test/lexical_cast_test.cpp6
5 files changed, 28 insertions, 10 deletions
diff --git a/libs/lexical_cast/README.md b/libs/lexical_cast/README.md
new file mode 100644
index 0000000000..e4cb9ccbf8
--- /dev/null
+++ b/libs/lexical_cast/README.md
@@ -0,0 +1,16 @@
+#[Boost.LexicalCast](http://boost.org/libs/lexical_cast)
+Boost.LexicalCast is one of the [Boost C++ Libraries](http://github.com/boostorg). This library is meant for general literal text conversions, such as an int represented a string, or vice-versa.
+
+### Test results
+
+@ | Build | Tests coverage | More info
+----------------|-------------- | -------------- |-----------
+Develop branch: | [![Build Status](https://travis-ci.org/apolukhin/lexical_cast.svg?branch=develop)](https://travis-ci.org/apolukhin/lexical_cast) | [![Coverage Status](https://coveralls.io/repos/apolukhin/lexical_cast/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/lexical_cast?branch=develop) | [details...](http://www.boost.org/development/tests/develop/developer/lexical_cast.html)
+Master branch: | [![Build Status](https://travis-ci.org/apolukhin/lexical_cast.svg?branch=master)](https://travis-ci.org/apolukhin/lexical_cast) | [![Coverage Status](https://coveralls.io/repos/apolukhin/lexical_cast/badge.png?branch=master)](https://coveralls.io/r/apolukhin/lexical_cast?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/lexical_cast.html)
+
+
+[Open Issues](https://svn.boost.org/trac/boost/query?status=!closed&component=lexical_cast)
+
+### License
+
+Distributed under the [Boost Software License, Version 1.0](http://boost.org/LICENSE_1_0.txt).
diff --git a/libs/lexical_cast/example/small_examples.cpp b/libs/lexical_cast/example/small_examples.cpp
index 31f3981d88..31cda49cc1 100644
--- a/libs/lexical_cast/example/small_examples.cpp
+++ b/libs/lexical_cast/example/small_examples.cpp
@@ -28,7 +28,7 @@ void number_to_file(int number, FILE* file)
{
typedef boost::array<char, 50> buf_t; // You can use std::array if your compiler supports it
buf_t buffer = boost::lexical_cast<buf_t>(number); // No dynamic memory allocation
- fputs(buffer.begin(), file);
+ std::fputs(buffer.begin(), file);
}
//] [/lexical_cast_fixed_buffer]
diff --git a/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp b/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp
index 551a349e2b..166b8bb330 100644
--- a/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp
@@ -148,7 +148,7 @@ void test_conversion_from_integral_to_integral()
T t = 0;
BOOST_CHECK(lexical_cast<T>(t) == t);
- // Next two variables are used to supress warnings.
+ // Next two variables are used to suppress warnings.
int st = 32767; unsigned int ut = st;
t = st;
BOOST_CHECK(lexical_cast<short>(t) == st);
@@ -221,7 +221,7 @@ void test_conversion_from_integral_to_string(CharT)
T const min_val = (limits::min)();
T const max_val = (limits::max)();
T const half_max_val = max_val / 2;
- T const cnt = lcast_integral_test_counter; // to supress warnings
+ T const cnt = lcast_integral_test_counter; // to suppress warnings
unsigned int const counter = cnt < half_max_val ? cnt : half_max_val;
unsigned int i;
@@ -317,7 +317,7 @@ void test_conversion_from_string_to_integral(CharT)
else
{
T const half_max_val = max_val / 2;
- T const cnt = lcast_integral_test_counter; // to supress warnings
+ T const cnt = lcast_integral_test_counter; // to suppress warnings
unsigned int const counter = cnt < half_max_val ? cnt : half_max_val;
T t;
diff --git a/libs/lexical_cast/test/lexical_cast_stream_traits_test.cpp b/libs/lexical_cast/test/lexical_cast_stream_traits_test.cpp
index e041fa9414..a085560e10 100644
--- a/libs/lexical_cast/test/lexical_cast_stream_traits_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_stream_traits_test.cpp
@@ -2,7 +2,7 @@
//
// See http://www.boost.org for most recent version, including documentation.
//
-// Copyright Antony Polukhin, 2012.
+// Copyright Antony Polukhin, 2012-2014.
//
// Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
@@ -10,7 +10,7 @@
#include <boost/config.hpp>
-#include <boost/lexical_cast.hpp>
+#include <boost/lexical_cast/detail/converter_lexical.hpp>
#include <boost/test/unit_test.hpp>
@@ -96,10 +96,6 @@ void test_metafunctions()
test_optimized_types_to_string<unsigned __int64>();
test_optimized_types_to_string<__int64>();
#endif
-
-#if !defined(BOOST_NO_SWPRINTF) && !defined(__MINGW32__)
- test_optimized_types_to_string<float>();
-#endif
test_optimized_types_to_string<std::string>();
test_optimized_types_to_string<char*>();
diff --git a/libs/lexical_cast/test/lexical_cast_test.cpp b/libs/lexical_cast/test/lexical_cast_test.cpp
index f27e6df078..5058b51237 100644
--- a/libs/lexical_cast/test/lexical_cast_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_test.cpp
@@ -56,6 +56,12 @@ struct my_traits : std::char_traits<CharT>
template<class CharT>
struct my_allocator : std::allocator<CharT>
{
+ typedef std::allocator<CharT> base_t;
+
+ my_allocator(){}
+ template <class U> my_allocator(const my_allocator<U>& v) : base_t(v) {}
+
+ template <class U> struct rebind { typedef my_allocator<U> other; };
};
using namespace boost;