2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-21 17:02:36 +00:00

Compare commits

..

15 Commits

Author SHA1 Message Date
Peter Dimov
95e1de198e Switch to LightweightTest to avoid deprecation warnings 2021-05-18 04:55:56 +03:00
Peter Dimov
86451f2238 Update test/Jamfile 2021-05-18 04:36:24 +03:00
Peter Dimov
a96b87e777 Merge branch 'develop' of https://github.com/Jac1494/lambda into feature/pr-17 2021-05-18 04:16:22 +03:00
Peter Dimov
bbbe1a9041 Update .travis.yml 2021-05-18 03:20:52 +03:00
Peter Dimov
1a8f8cfead Update .travis.yml 2021-05-18 03:18:03 +03:00
Peter Dimov
7be3075575 Merge branch 'develop' 2021-05-18 03:10:07 +03:00
Peter Dimov
ddf7dfe25e Add CMakeLists.txt 2021-03-19 04:33:05 +02:00
Glen Fernandes
8de6d9cb9f Make all include guards BOOST_LAMBDA_ prefixed 2019-12-24 18:54:19 -05:00
Jaydeep Chauhan
641dd2b0a6 Disabled one test which returns local address 2019-07-25 18:19:15 +05:30
Glen Fernandes
d27fc70114 Merge pull request #14 from tinko92/develop
Fix broken sgi/stl links.
2019-04-24 05:49:02 +10:00
Tinko Bartels
1c11cf9570 Fix broken sgi/stl links. 2019-04-23 19:38:24 +02:00
Edward Diener
7355f36b9f Updated for b2 cmake support. 2018-12-19 22:30:41 -05:00
Edward Diener
8824e81d52 Merge branch 'develop' 2018-10-25 22:20:53 -04:00
Edward Diener
6395013860 Merge pull request #13 from danieljames/remove-random-shuffle-support-when-appropriate
Only support std::random_shuffle when available
2018-04-19 23:43:00 -04:00
Daniel James
8c0410fff5 Only support std::random_shuffle when available
It was removed in C++17. We could emulate it when it isn't available,
but that doesn't seem worth the effort.
2018-04-07 15:10:29 +01:00
27 changed files with 272 additions and 127 deletions

View File

@@ -1,28 +1,152 @@
# Copyright 2016 Edward Diener
# Copyright 2016, 2017, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
sudo: false
python: "2.7"
os:
- linux
- osx
dist: xenial
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++-4.4
env: TOOLSET=gcc CXXSTD=98
addons:
apt:
packages:
- g++-4.4
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.6
env: TOOLSET=gcc CXXSTD=03,0x
addons:
apt:
packages:
- g++-4.6
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.8
env: TOOLSET=gcc CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-5
env: TOOLSET=gcc CXXSTD=03,11,14
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-7
env: TOOLSET=gcc CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-9
env: TOOLSET=gcc CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: bionic
compiler: g++-10
env: TOOLSET=gcc CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- g++-10
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: bionic
compiler: g++-11
env: UBSAN=1 TOOLSET=gcc CXXSTD=03,11,14,17,20 UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
addons:
apt:
packages:
- g++-11
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
compiler: clang++-11
env: TOOLSET=clang CXXSTD=03,11,14,17,20
addons:
apt:
packages:
- clang-11
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-11 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
compiler: clang++-12
env: UBSAN=1 TOOLSET=clang CXXSTD=03,11,14,17,20 UBSAN_OPTIONS=print_stacktrace=1
addons:
apt:
packages:
- clang-12
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
dist: bionic
compiler: clang++-libc++
env: UBSAN=1 TOOLSET=clang CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
addons:
apt:
packages:
- libc++-dev
- os: osx
compiler: clang++
env: UBSAN=1 TOOLSET=clang CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/lambda
- python tools/boostdep/depinst/depinst.py lambda
@@ -30,10 +154,9 @@ install:
- ./b2 headers
script:
- TOOLSET=gcc,clang
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
- ./b2 --verbose-test libs/config/test//config_info toolset=$TOOLSET || true
- ./b2 libs/lambda/test toolset=$TOOLSET
- |-
echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/user-config.jam
- ./b2 -j3 libs/lambda/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
notifications:
email:

34
CMakeLists.txt Normal file
View File

@@ -0,0 +1,34 @@
# Generated by `boostdep --cmake lambda`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_lambda VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_lambda INTERFACE)
add_library(Boost::lambda ALIAS boost_lambda)
target_include_directories(boost_lambda INTERFACE include)
target_link_libraries(boost_lambda
INTERFACE
Boost::bind
Boost::config
Boost::core
Boost::detail
Boost::iterator
Boost::mpl
Boost::preprocessor
Boost::tuple
Boost::type_traits
Boost::utility
)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

View File

@@ -25,6 +25,8 @@ install:
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\lambda
- python tools/boostdep/depinst/depinst.py lambda
- bootstrap

View File

@@ -3281,7 +3281,7 @@ was dropped.
<abbrev>SGI02</abbrev>
<title>The SGI Standard Template Library</title>
<pubdate>2002</pubdate>
<bibliomisc><ulink url="http://www.sgi.com/tech/stl/">www.sgi.com/tech/stl/</ulink></bibliomisc>
<bibliomisc><ulink url="https://www.boost.org/sgi/stl/">www.boost.org/sgi/stl/</ulink></bibliomisc>
</biblioentry>

View File

@@ -3286,7 +3286,7 @@ was dropped.
<abbrev>SGI02</abbrev>
<title>The SGI Standard Template Library</title>
<pubdate>2002</pubdate>
<bibliomisc><ulink url="http://www.sgi.com/tech/stl/">www.sgi.com/tech/stl/</ulink></bibliomisc>
<bibliomisc><ulink url="https://www.boost.org/sgi/stl/">www.boost.org/sgi/stl/</ulink></bibliomisc>
</biblioentry>

View File

@@ -684,6 +684,8 @@ struct rotate_copy {
// random_shuffle ---------------------------------
#ifndef BOOST_NO_CXX98_RANDOM_SHUFFLE
struct random_shuffle {
template <class Args>
@@ -703,6 +705,7 @@ struct random_shuffle {
};
#endif
// partition ---------------------------------

View File

@@ -11,8 +11,8 @@
URL: http://spirit.sourceforge.net/
==============================================================================*/
#ifndef PHOENIX_CLOSURES_HPP
#define PHOENIX_CLOSURES_HPP
#ifndef BOOST_LAMBDA_CLOSURES_HPP
#define BOOST_LAMBDA_CLOSURES_HPP
///////////////////////////////////////////////////////////////////////////////
#include "boost/lambda/core.hpp"

View File

@@ -10,26 +10,22 @@
import testing ;
project
: requirements <toolset>msvc:<asynch-exceptions>on
;
test-suite lambda
: [ run algorithm_test.cpp ]
[ run bind_tests_simple.cpp ]
[ run bind_tests_advanced.cpp ]
[ run bind_tests_simple_f_refs.cpp ]
[ run bll_and_function.cpp ]
[ run cast_test.cpp : : : : lambda_cast_test ]
[ run constructor_tests.cpp ]
[ run control_structures.cpp ]
[ run exception_test.cpp ]
[ run extending_rt_traits.cpp ]
[ run is_instance_of_test.cpp ]
[ run member_pointer_test.cpp ]
[ run operator_tests_simple.cpp ]
[ run phoenix_control_structures.cpp ]
[ run switch_construct.cpp ]
[ run result_of_tests.cpp ]
[ run ret_test.cpp ]
;
run algorithm_test.cpp ;
run bind_tests_advanced.cpp ;
run bind_tests_simple.cpp ;
run bind_tests_simple_f_refs.cpp ;
run bll_and_function.cpp ;
run cast_test.cpp ;
run constructor_tests.cpp ;
run control_structures.cpp ;
run exception_test.cpp ;
run extending_rt_traits.cpp ;
run is_instance_of_test.cpp ;
run istreambuf_test.cpp ;
run member_pointer_test.cpp ;
run operator_tests_simple.cpp ;
run phoenix_control_structures.cpp ;
run result_of_tests.cpp ;
run ret_test.cpp ;
run rvalue_test.cpp ;
run switch_construct.cpp ;

View File

@@ -11,7 +11,8 @@
// test using BLL and boost::function
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp"
@@ -46,15 +47,9 @@ void test_foreach() {
// More tests needed (for all algorithms)
int test_main(int, char *[]) {
int main() {
test_foreach();
return 0;
return boost::report_errors();
}

View File

@@ -13,7 +13,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp"
@@ -413,7 +414,7 @@ void test_abstract()
BOOST_CHECK(bind(&base::foo, *_1)(&b) == 1);
}
int test_main(int, char *[]) {
int main() {
test_nested_binds();
test_unlambda();
@@ -424,5 +425,5 @@ int test_main(int, char *[]) {
test_break_const();
test_sig();
test_abstract();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp"
@@ -97,7 +98,7 @@ void test_data_members()
BOOST_CHECK(b.i == 1);
}
int test_main(int, char *[]) {
int main() {
int i = 1; int j = 2; int k = 3;
int result;
@@ -183,5 +184,5 @@ int test_main(int, char *[]) {
test_member_functions();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp"
@@ -57,7 +58,7 @@ void test_member_functions()
// bind(&A::add, a, _1);
}
int test_main(int, char *[]) {
int main() {
int i = 1; int j = 2; int k = 3;
int result;
@@ -144,5 +145,5 @@ int test_main(int, char *[]) {
test_member_functions();
return 0;
return boost::report_errors();
}

View File

@@ -11,7 +11,8 @@
// test using BLL and boost::function
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -54,15 +55,9 @@ void test_function() {
}
int test_main(int, char *[]) {
int main() {
test_function();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -100,8 +101,8 @@ void do_test() {
}
int test_main(int, char *[]) {
int main() {
do_test();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -252,7 +253,7 @@ void delayed_construction()
bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
}
int test_main(int, char *[]) {
int main() {
constructor_all_lengths();
new_ptr_all_lengths();
@@ -261,5 +262,5 @@ int test_main(int, char *[]) {
test_news_and_deletes();
test_array_new_and_delete();
return 0;
return boost::report_errors();
}

View File

@@ -11,7 +11,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/if.hpp"
@@ -115,9 +116,9 @@ void simple_ifs () {
}
int test_main(int, char *[])
int main()
{
simple_loops();
simple_ifs();
return 0;
return boost::report_errors();
}

View File

@@ -11,7 +11,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -595,7 +596,7 @@ void return_type_matching() {
BOOST_CHECK(a == 'b');
}
int test_main(int, char *[]) {
int main() {
try
{
@@ -613,9 +614,5 @@ int test_main(int, char *[]) {
}
return EXIT_SUCCESS;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/bind.hpp"
#include "boost/lambda/lambda.hpp"
@@ -381,14 +382,8 @@ void test_binary_operators() {
}
int test_main(int, char *[]) {
int main() {
test_unary_operators();
test_binary_operators();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/detail/is_instance_of.hpp"
@@ -45,7 +46,7 @@ template <bool b> class X {};
X<boost::lambda::is_instance_of_2<int, A2>::value> x;
int test_main(int, char *[]) {
int main() {
using boost::lambda::is_instance_of_1;
using boost::lambda::is_instance_of_2;
@@ -73,7 +74,6 @@ BOOST_CHECK((is_instance_of_4<A4<int, float, char, double>, A4>::value == true))
BOOST_CHECK((is_instance_of_4<int, A4>::value == false));
BOOST_CHECK((is_instance_of_4<C4, A4>::value == false));
return 0;
return boost::report_errors();
}

View File

@@ -7,7 +7,7 @@
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/lambda/lambda.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <iterator>
#include <sstream>
#include <algorithm>

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -182,11 +183,10 @@ void test_overloaded_pointer_to_member()
}
int test_main(int, char *[]) {
int main() {
pointer_to_data_member_tests();
pointer_to_member_function_tests();
test_overloaded_pointer_to_member();
return 0;
return boost::report_errors();
}

View File

@@ -13,7 +13,8 @@
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -408,7 +409,7 @@ void pointer_arithmetic() {
}
int test_main(int, char *[]) {
int main() {
arithmetic_operators();
bitwise_operators();
@@ -421,11 +422,5 @@ int test_main(int, char *[]) {
comma();
pointer_arithmetic();
cout_tests();
return 0;
return boost::report_errors();
}

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/if.hpp"
@@ -36,7 +37,7 @@ using namespace std;
// If-else, while, do-while, for statements
int test_main(int, char *[]) {
int main() {
vector<int> v;
v.clear();
@@ -143,6 +144,5 @@ int test_main(int, char *[]) {
v = t;
return 0;
return boost::report_errors();
}

View File

@@ -11,7 +11,9 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/mpl/assert.hpp>
@@ -252,7 +254,7 @@ typename boost::result_of<F(A, B, C)>::type apply3(F f, A a, B b, C c) {
using namespace boost::lambda;
int test_main(int, char *[]) {
int main() {
BOOST_CHECK(boost::lambda::bind(with_result_type())() == 0);
BOOST_CHECK(boost::lambda::bind(with_result_type(), 1)() == 1);
BOOST_CHECK(boost::lambda::bind(with_result_type(), 1, 2)() == 2);
@@ -300,7 +302,8 @@ int test_main(int, char *[]) {
// Check using result_of with lambda functors
BOOST_CHECK(apply0(constant(0)) == 0);
BOOST_CHECK(apply1<int>(_1, one) == 1);
// returns local address and leads to undefined behavior
//~ BOOST_CHECK(apply1<int>(_1, one) == 1);
BOOST_CHECK(apply1<int&>(_1, one) == 1);
BOOST_CHECK(apply1<const int&>(_1, one) == 1);
BOOST_CHECK((apply2<int, int>(_1 + _2, one, two) == 3));
@@ -310,5 +313,5 @@ int test_main(int, char *[]) {
BOOST_CHECK((apply3<int&, int&, int&>(_1 + _2 + _3, one, two, three) == 6));
BOOST_CHECK((apply3<const int&, const int&, const int&>(_1 + _2 + _3, one, two, three) == 6));
return 0;
return boost::report_errors();
}

View File

@@ -8,7 +8,8 @@
//
// For more information, see www.boost.org
#include <boost/test/minimal.hpp>
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include <boost/lambda/lambda.hpp>
@@ -44,10 +45,10 @@ add_result operator+(addable, addable) {
return add_result(7);
}
int test_main(int, char*[]) {
int main() {
addable test;
test_ret(add_result(7), boost::lambda::ret<add_result>(boost::lambda::_1 + test), test);
test_ret(8.0, boost::lambda::ret<double>(boost::lambda::constant(7) + 1));
return 0;
return boost::report_errors();
}

View File

@@ -7,7 +7,7 @@
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/lambda/lambda.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{

View File

@@ -12,7 +12,8 @@
// -----------------------------------------------------------------------
#include <boost/test/minimal.hpp> // see "Header Implementation Option"
#include <boost/core/lightweight_test.hpp>
#define BOOST_CHECK BOOST_TEST
#include "boost/lambda/lambda.hpp"
@@ -379,14 +380,13 @@ void test_empty_cases() {
}
int test_main(int, char* []) {
int main() {
do_switch_no_defaults_tests();
do_switch_yes_defaults_tests();
test_empty_cases();
return EXIT_SUCCESS;
return boost::report_errors();
}