-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more macros for removed std lib features:
BOOST_NO_CXX98_FUNCTION_BASE BOOST_NO_CXX98_BINDERS Added new documentation section for features that have been removed from the standard.
- Loading branch information
Showing
16 changed files
with
387 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// (C) Copyright John Maddock 2017. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for most recent version. | ||
|
||
// MACRO: BOOST_NO_CXX98_BINDERS | ||
// TITLE: std::bind1st, prt_fun and mem_fun | ||
// DESCRIPTION: The std lib has C++98 binders and adaptors. | ||
|
||
#include <functional> | ||
|
||
namespace boost_no_cxx98_binders{ | ||
|
||
int f2(int a, int b) { return a + b; } | ||
|
||
struct A | ||
{ | ||
int f1(int a) { return a; } | ||
}; | ||
|
||
|
||
int test() | ||
{ | ||
A a; | ||
return std::bind1st(std::ptr_fun(f2), 0)(0) + std::bind1st(std::mem_fun(&A::f1), &a)(0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// (C) Copyright John Maddock 2017. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for most recent version. | ||
|
||
// MACRO: BOOST_NO_CXX98_FUNCTION_BASE | ||
// TITLE: std::unary_function and std::binary_function | ||
// DESCRIPTION: The std lib has unary_function and binary_function. | ||
|
||
#include <functional> | ||
|
||
namespace boost_no_cxx98_function_base{ | ||
|
||
struct A : public std::unary_function<int, int>{}; | ||
struct B : public std::binary_function<int, int, int>{}; | ||
|
||
int test() | ||
{ | ||
A a; | ||
B b; | ||
(void)a; | ||
(void)b; | ||
return static_cast<B::result_type>(0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// (C) Copyright John Maddock 2017. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for most recent version. | ||
|
||
// MACRO: BOOST_NO_CXX98_RANDOM_SHUFFLE | ||
// TITLE: std::random_shuffle | ||
// DESCRIPTION: The std lib has random_shuffle. | ||
|
||
#include <algorithm> | ||
|
||
namespace boost_no_cxx98_random_shuffle{ | ||
|
||
int test() | ||
{ | ||
int my_array[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; | ||
std::random_shuffle(&my_array[0], &my_array[9] ); | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file was automatically generated on Mon Apr 17 18:06:53 2017 | ||
// by libs/config/tools/generate.cpp | ||
// Copyright John Maddock 2002-4. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for the most recent version.// | ||
// Revision $Id$ | ||
// | ||
|
||
|
||
// Test file for macro BOOST_NO_CXX98_BINDERS | ||
// This file should not compile, if it does then | ||
// BOOST_NO_CXX98_BINDERS should not be defined. | ||
// See file boost_no_cxx98_binders.ipp for details | ||
|
||
// Must not have BOOST_ASSERT_CONFIG set; it defeats | ||
// the objective of this file: | ||
#ifdef BOOST_ASSERT_CONFIG | ||
# undef BOOST_ASSERT_CONFIG | ||
#endif | ||
|
||
#include <boost/config.hpp> | ||
#include "test.hpp" | ||
|
||
#ifdef BOOST_NO_CXX98_BINDERS | ||
#include "boost_no_cxx98_binders.ipp" | ||
#else | ||
#error "this file should not compile" | ||
#endif | ||
|
||
int main( int, char *[] ) | ||
{ | ||
return boost_no_cxx98_binders::test(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file was automatically generated on Mon Apr 17 18:06:53 2017 | ||
// by libs/config/tools/generate.cpp | ||
// Copyright John Maddock 2002-4. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for the most recent version.// | ||
// Revision $Id$ | ||
// | ||
|
||
|
||
// Test file for macro BOOST_NO_CXX98_BINDERS | ||
// This file should compile, if it does not then | ||
// BOOST_NO_CXX98_BINDERS should be defined. | ||
// See file boost_no_cxx98_binders.ipp for details | ||
|
||
// Must not have BOOST_ASSERT_CONFIG set; it defeats | ||
// the objective of this file: | ||
#ifdef BOOST_ASSERT_CONFIG | ||
# undef BOOST_ASSERT_CONFIG | ||
#endif | ||
|
||
#include <boost/config.hpp> | ||
#include "test.hpp" | ||
|
||
#ifndef BOOST_NO_CXX98_BINDERS | ||
#include "boost_no_cxx98_binders.ipp" | ||
#else | ||
namespace boost_no_cxx98_binders = empty_boost; | ||
#endif | ||
|
||
int main( int, char *[] ) | ||
{ | ||
return boost_no_cxx98_binders::test(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file was automatically generated on Mon Apr 17 18:35:53 2017 | ||
// by libs/config/tools/generate.cpp | ||
// Copyright John Maddock 2002-4. | ||
// Use, modification and distribution are subject to 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) | ||
|
||
// See http://www.boost.org/libs/config for the most recent version.// | ||
// Revision $Id$ | ||
// | ||
|
||
|
||
// Test file for macro BOOST_NO_CXX98_FUNCTION_BASE | ||
// This file should not compile, if it does then | ||
// BOOST_NO_CXX98_FUNCTION_BASE should not be defined. | ||
// See file boost_no_cxx98_function_base.ipp for details | ||
|
||
// Must not have BOOST_ASSERT_CONFIG set; it defeats | ||
// the objective of this file: | ||
#ifdef BOOST_ASSERT_CONFIG | ||
# undef BOOST_ASSERT_CONFIG | ||
#endif | ||
|
||
#include <boost/config.hpp> | ||
#include "test.hpp" | ||
|
||
#ifdef BOOST_NO_CXX98_FUNCTION_BASE | ||
#include "boost_no_cxx98_function_base.ipp" | ||
#else | ||
#error "this file should not compile" | ||
#endif | ||
|
||
int main( int, char *[] ) | ||
{ | ||
return boost_no_cxx98_function_base::test(); | ||
} | ||
|
Oops, something went wrong.
0e364ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, the removal of old deprecated library features is a C++17 thing, not C++14.
0e364ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0e364ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. 'This International Standard' is C++17 (DIS N4618.pdf). The request for removal from the (then next) standard was N4190 by STL, date 2014-10-09, i.e. after finalization of C++14 in august 2014 (publication in december)