summaryrefslogtreecommitdiff
path: root/libs/lexical_cast
diff options
context:
space:
mode:
Diffstat (limited to 'libs/lexical_cast')
-rw-r--r--libs/lexical_cast/README.md6
-rw-r--r--libs/lexical_cast/doc/Jamfile.v29
-rw-r--r--libs/lexical_cast/example/generic_stringize.cpp6
-rw-r--r--libs/lexical_cast/example/small_examples.cpp6
-rw-r--r--libs/lexical_cast/example/variant_to_long_double.cpp8
-rw-r--r--libs/lexical_cast/test/Jamfile.v219
-rw-r--r--libs/lexical_cast/test/lexical_cast_abstract_test.cpp1
-rw-r--r--libs/lexical_cast/test/lexical_cast_arrays_test.cpp4
-rw-r--r--libs/lexical_cast/test/lexical_cast_integral_types_test.cpp4
-rw-r--r--libs/lexical_cast/test/lexical_cast_iterator_range_test.cpp4
-rw-r--r--libs/lexical_cast/test/lexical_cast_vc8_bug_test.cpp12
11 files changed, 57 insertions, 22 deletions
diff --git a/libs/lexical_cast/README.md b/libs/lexical_cast/README.md
index e4cb9ccbf8..4a804f4459 100644
--- a/libs/lexical_cast/README.md
+++ b/libs/lexical_cast/README.md
@@ -1,12 +1,12 @@
-#[Boost.LexicalCast](http://boost.org/libs/lexical_cast)
+# [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)
+Develop branch: | [![Build Status](https://travis-ci.org/apolukhin/lexical_cast.svg?branch=develop)](https://travis-ci.org/apolukhin/lexical_cast) [![Build status](https://ci.appveyor.com/api/projects/status/mwwanh1bpsnuv38h/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/lexical-cast/branch/develop) | [![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) [![Build status](https://ci.appveyor.com/api/projects/status/mwwanh1bpsnuv38h/branch/master?svg=true)](https://ci.appveyor.com/project/apolukhin/lexical-cast/branch/master) | [![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)
diff --git a/libs/lexical_cast/doc/Jamfile.v2 b/libs/lexical_cast/doc/Jamfile.v2
index 0b47ee3921..1d6e151cea 100644
--- a/libs/lexical_cast/doc/Jamfile.v2
+++ b/libs/lexical_cast/doc/Jamfile.v2
@@ -14,3 +14,12 @@ boostbook standalone
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
;
+###############################################################################
+alias boostdoc
+ : lexical_cast
+ :
+ :
+ : ;
+explicit boostdoc ;
+alias boostrelease ;
+explicit boostrelease ;
diff --git a/libs/lexical_cast/example/generic_stringize.cpp b/libs/lexical_cast/example/generic_stringize.cpp
index d480ba5fa1..cf4c762531 100644
--- a/libs/lexical_cast/example/generic_stringize.cpp
+++ b/libs/lexical_cast/example/generic_stringize.cpp
@@ -1,9 +1,13 @@
-// Copyright 2013 Antony Polukhin
+// Copyright 2013-2017 Antony Polukhin
// Distributed under the Boost Software License, Version 1.0.
// (See the accompanying file LICENSE_1_0.txt
// or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4512) // generic_stringize.cpp(37) : warning C4512: 'stringize_functor' : assignment operator could not be generated
+#endif
//[lexical_cast_stringize
/*`
diff --git a/libs/lexical_cast/example/small_examples.cpp b/libs/lexical_cast/example/small_examples.cpp
index 31cda49cc1..ae9a88ea11 100644
--- a/libs/lexical_cast/example/small_examples.cpp
+++ b/libs/lexical_cast/example/small_examples.cpp
@@ -1,4 +1,4 @@
-// Copyright 2013 Antony Polukhin
+// Copyright 2013-2017 Antony Polukhin
// Distributed under the Boost Software License, Version 1.0.
// (See the accompanying file LICENSE_1_0.txt
@@ -8,6 +8,10 @@
#include <string>
#include <cstdio>
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4996) // `strerror` is not safe
+#endif
+
//[lexical_cast_log_errno
//`The following example uses numeric data in a string expression:
diff --git a/libs/lexical_cast/example/variant_to_long_double.cpp b/libs/lexical_cast/example/variant_to_long_double.cpp
index 2ed95a8a69..9b1aa27854 100644
--- a/libs/lexical_cast/example/variant_to_long_double.cpp
+++ b/libs/lexical_cast/example/variant_to_long_double.cpp
@@ -1,4 +1,4 @@
-// Copyright 2013 Antony Polukhin
+// Copyright 2013-2017 Antony Polukhin
// Distributed under the Boost Software License, Version 1.0.
// (See the accompanying file LICENSE_1_0.txt
@@ -32,8 +32,10 @@ long double to_long_double(const Variant& v) {
int main() {
boost::variant<char, int, std::string> v1('0'), v2("10.0001"), v3(1);
- long double sum = to_long_double(v1) + to_long_double(v2) + to_long_double(v3);
- assert(sum > 11 && sum < 11.1);
+ const long double sum = to_long_double(v1) + to_long_double(v2) + to_long_double(v3);
+ const int ret = (sum > 11 && sum < 11.1 ? 0 : 1);
+ assert(ret == 0);
+ return ret;
}
//] [/lexical_cast_variant_to_long_double]
diff --git a/libs/lexical_cast/test/Jamfile.v2 b/libs/lexical_cast/test/Jamfile.v2
index 83d6ad46b5..ba422c8165 100644
--- a/libs/lexical_cast/test/Jamfile.v2
+++ b/libs/lexical_cast/test/Jamfile.v2
@@ -1,5 +1,5 @@
# Copyright (C) 2001-2003 Douglas Gregor
-# Copyright (C) 2011-2014 Antony Polukhin
+# Copyright (C) 2011-2017 Antony Polukhin
#
# 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)
@@ -19,7 +19,14 @@ project
<warnings>all
# set warnings as errors for those compilers we know we get warning free:
<toolset>gcc:<cxxflags>-Wextra
- <toolset>gcc:<cxxflags>-Wno-uninitialized
+
+ # Not a lexical_cast related warning: boost/preprocessor/variadic/elem.hpp:29:46: warning: variadic macros are a C99 feature
+ <toolset>clang:<cxxflags>-Wno-variadic-macros
+ <toolset>gcc:<cxxflags>-Wno-variadic-macros
+
+ # Not a lexical_cast related warning: boost/mpl/aux_/preprocessed/gcc/greater_equal.hpp:78:1: warning: empty macro arguments are a C99 feature [-Wc99-extensions]
+ # boost/mpl/iter_fold.hpp:45:1: warning: empty macro arguments are a C99 feature [-Wc99-extensions]
+ <toolset>clang:<cxxflags>-Wno-c99-extensions
;
# Thanks to Steven Watanabe for helping with <nowchar> feature
@@ -52,14 +59,18 @@ test-suite conversion
<toolset>clang:<cxxflags>-fno-exceptions
]
[ run lexical_cast_iterator_range_test.cpp ]
- [ run lexical_cast_arrays_test.cpp ]
+ [ run lexical_cast_arrays_test.cpp : : :
+ <toolset>msvc:<cxxflags>/wd4512 # assignment operator could not be generated
+ ]
[ run lexical_cast_integral_types_test.cpp ]
[ run lexical_cast_stream_detection_test.cpp ]
[ run lexical_cast_stream_traits_test.cpp ]
[ compile-fail lexical_cast_to_pointer_test.cpp ]
[ run lexical_cast_filesystem_test.cpp ../../filesystem/build//boost_filesystem/<link>static ]
[ run lexical_cast_try_lexical_convert.cpp ]
- [ run lexical_cast_no_comp_time_prcision.cpp ]
+ [ run lexical_cast_no_comp_time_prcision.cpp : : :
+ <toolset>msvc:<cxxflags>/wd4127 # conditional expression is constant
+ ]
;
# Assuring that examples compile and run. Adding sources from `example` directory to the `conversion` test suite.
diff --git a/libs/lexical_cast/test/lexical_cast_abstract_test.cpp b/libs/lexical_cast/test/lexical_cast_abstract_test.cpp
index 70cdecae31..ff1b2bb048 100644
--- a/libs/lexical_cast/test/lexical_cast_abstract_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_abstract_test.cpp
@@ -39,6 +39,7 @@ class A
{
public:
virtual void out(std::ostream &) const = 0;
+ virtual ~A() {}
};
class B: public A
diff --git a/libs/lexical_cast/test/lexical_cast_arrays_test.cpp b/libs/lexical_cast/test/lexical_cast_arrays_test.cpp
index 013f40125b..476614fcb8 100644
--- a/libs/lexical_cast/test/lexical_cast_arrays_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_arrays_test.cpp
@@ -22,11 +22,11 @@ void testing_std_array_input_conversion();
using namespace boost;
-#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
#define BOOST_LC_RUNU16
#endif
-#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
#define BOOST_LC_RUNU32
#endif
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 166b8bb330..9780c76137 100644
--- a/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_integral_types_test.cpp
@@ -425,12 +425,12 @@ void test_conversion_from_to_integral_minimal()
test_conversion_from_integral_to_char<T>(wzero);
test_conversion_from_char_to_integral<T>(wzero);
#endif
-#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
char16_t const u16zero = u'0';
test_conversion_from_integral_to_char<T>(u16zero);
test_conversion_from_char_to_integral<T>(u16zero);
#endif
-#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
char32_t const u32zero = u'0';
test_conversion_from_integral_to_char<T>(u32zero);
test_conversion_from_char_to_integral<T>(u32zero);
diff --git a/libs/lexical_cast/test/lexical_cast_iterator_range_test.cpp b/libs/lexical_cast/test/lexical_cast_iterator_range_test.cpp
index 1b4a3efd77..c07d41aa69 100644
--- a/libs/lexical_cast/test/lexical_cast_iterator_range_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_iterator_range_test.cpp
@@ -28,11 +28,11 @@ using namespace boost;
#endif
-#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
#define BOOST_LC_RUNU16
#endif
-#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION)
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(_LIBCPP_VERSION) && !defined(BOOST_MSVC)
#define BOOST_LC_RUNU32
#endif
diff --git a/libs/lexical_cast/test/lexical_cast_vc8_bug_test.cpp b/libs/lexical_cast/test/lexical_cast_vc8_bug_test.cpp
index 35c740339e..0f5b24fbdb 100644
--- a/libs/lexical_cast/test/lexical_cast_vc8_bug_test.cpp
+++ b/libs/lexical_cast/test/lexical_cast_vc8_bug_test.cpp
@@ -19,6 +19,10 @@
#include <string>
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4127) // conditional expression is constant
+#endif
+
using namespace boost;
// See also test_conversion_from_string_to_integral(CharT)
@@ -37,11 +41,11 @@ void test_too_long_number(CharT zero)
s[s.size()-1] += static_cast<CharT>(9); // '0' -> '9'
BOOST_CHECK_THROW(lexical_cast<T>(s), bad_lexical_cast);
- if(limits::is_signed)
+ if (limits::is_signed)
{
- std::basic_ostringstream<CharT> o;
- o << (limits::min)() << zero;
- s = o.str();
+ std::basic_ostringstream<CharT> o2;
+ o2 << (limits::min)() << zero;
+ s = o2.str();
BOOST_CHECK_THROW(lexical_cast<T>(s), bad_lexical_cast);
s[s.size()-1] += static_cast<CharT>(9); // '0' -> '9'
BOOST_CHECK_THROW(lexical_cast<T>(s), bad_lexical_cast);