mirror of
https://github.com/boostorg/lambda.git
synced 2026-01-24 18:02:22 +00:00
Compare commits
1 Commits
feature/tr
...
sandbox-br
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5769fc1a39 |
172
.travis.yml
172
.travis.yml
@@ -1,172 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
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: TOOLSET=clang CXXSTD=03,11,14,17,2a
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- libc++-dev
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
dist: focal
|
|
||||||
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 $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
|
|
||||||
- cd boost-root
|
|
||||||
- git submodule update --init tools/boostdep
|
|
||||||
- cp -r $TRAVIS_BUILD_DIR/* libs/lambda
|
|
||||||
- python tools/boostdep/depinst/depinst.py lambda
|
|
||||||
- ./bootstrap.sh
|
|
||||||
- ./b2 headers
|
|
||||||
|
|
||||||
script:
|
|
||||||
- |-
|
|
||||||
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:
|
|
||||||
on_success: always
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
# 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()
|
|
||||||
|
|
||||||
38
appveyor.yml
38
appveyor.yml
@@ -1,38 +0,0 @@
|
|||||||
# Copyright 2017 Edward Diener
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
version: 1.0.{build}-{branch}
|
|
||||||
|
|
||||||
shallow_clone: true
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
|
|
||||||
environment:
|
|
||||||
matrix:
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0,msvc-14.0
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
||||||
TOOLSET: msvc-14.1
|
|
||||||
|
|
||||||
install:
|
|
||||||
- cd ..
|
|
||||||
- git clone -b %APPVEYOR_REPO_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
|
|
||||||
- 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
|
|
||||||
- b2 headers
|
|
||||||
|
|
||||||
build: off
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
- b2 libs/lambda/test toolset=%TOOLSET%
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
project lambda/doc ;
|
project boost/doc ;
|
||||||
import boostbook : boostbook ;
|
import boostbook : boostbook ;
|
||||||
|
|
||||||
# Are these really the correct images??
|
# Are these really the correct images??
|
||||||
@@ -10,12 +10,3 @@ boostbook lambda-doc : lambda.xml
|
|||||||
<format>pdf:<xsl:param>img.src.path=$(images)/
|
<format>pdf:<xsl:param>img.src.path=$(images)/
|
||||||
;
|
;
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
alias boostdoc
|
|
||||||
: lambda.xml
|
|
||||||
:
|
|
||||||
:
|
|
||||||
: ;
|
|
||||||
explicit boostdoc ;
|
|
||||||
alias boostrelease ;
|
|
||||||
explicit boostrelease ;
|
|
||||||
|
|||||||
@@ -3281,7 +3281,7 @@ was dropped.
|
|||||||
<abbrev>SGI02</abbrev>
|
<abbrev>SGI02</abbrev>
|
||||||
<title>The SGI Standard Template Library</title>
|
<title>The SGI Standard Template Library</title>
|
||||||
<pubdate>2002</pubdate>
|
<pubdate>2002</pubdate>
|
||||||
<bibliomisc><ulink url="https://www.boost.org/sgi/stl/">www.boost.org/sgi/stl/</ulink></bibliomisc>
|
<bibliomisc><ulink url="http://www.sgi.com/tech/stl/">www.sgi.com/tech/stl/</ulink></bibliomisc>
|
||||||
|
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
|
|
||||||
@@ -3435,7 +3435,7 @@ was dropped.
|
|||||||
<firstname>Brian</firstname>
|
<firstname>Brian</firstname>
|
||||||
<surname>McNamara</surname>
|
<surname>McNamara</surname>
|
||||||
</author>
|
</author>
|
||||||
<bibliomisc><ulink url="http://yanniss.github.io/fc++/">yanniss.github.io/fc++/ </ulink>
|
<bibliomisc><ulink url="http://www.cc.gatech.edu/~yannis/fc++/">www.cc.gatech.edu/~yannis/fc++/</ulink>
|
||||||
</bibliomisc>
|
</bibliomisc>
|
||||||
<pubdate>2002</pubdate>
|
<pubdate>2002</pubdate>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
|
|||||||
@@ -3286,7 +3286,7 @@ was dropped.
|
|||||||
<abbrev>SGI02</abbrev>
|
<abbrev>SGI02</abbrev>
|
||||||
<title>The SGI Standard Template Library</title>
|
<title>The SGI Standard Template Library</title>
|
||||||
<pubdate>2002</pubdate>
|
<pubdate>2002</pubdate>
|
||||||
<bibliomisc><ulink url="https://www.boost.org/sgi/stl/">www.boost.org/sgi/stl/</ulink></bibliomisc>
|
<bibliomisc><ulink url="http://www.sgi.com/tech/stl/">www.sgi.com/tech/stl/</ulink></bibliomisc>
|
||||||
|
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
|
|
||||||
@@ -3440,7 +3440,7 @@ was dropped.
|
|||||||
<firstname>Brian</firstname>
|
<firstname>Brian</firstname>
|
||||||
<surname>McNamara</surname>
|
<surname>McNamara</surname>
|
||||||
</author>
|
</author>
|
||||||
<bibliomisc><ulink url="http://yanniss.github.io/fc++/">yanniss.github.io/fc++/ </ulink>
|
<bibliomisc><ulink url="http://www.cc.gatech.edu/~yannis/fc++/">www.cc.gatech.edu/~yannis/fc++/</ulink>
|
||||||
</bibliomisc>
|
</bibliomisc>
|
||||||
<pubdate>2002</pubdate>
|
<pubdate>2002</pubdate>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
|
|||||||
@@ -684,8 +684,6 @@ struct rotate_copy {
|
|||||||
|
|
||||||
// random_shuffle ---------------------------------
|
// random_shuffle ---------------------------------
|
||||||
|
|
||||||
#ifndef BOOST_NO_CXX98_RANDOM_SHUFFLE
|
|
||||||
|
|
||||||
struct random_shuffle {
|
struct random_shuffle {
|
||||||
|
|
||||||
template <class Args>
|
template <class Args>
|
||||||
@@ -705,7 +703,6 @@ struct random_shuffle {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// partition ---------------------------------
|
// partition ---------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
URL: http://spirit.sourceforge.net/
|
URL: http://spirit.sourceforge.net/
|
||||||
|
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
#ifndef BOOST_LAMBDA_CLOSURES_HPP
|
#ifndef PHOENIX_CLOSURES_HPP
|
||||||
#define BOOST_LAMBDA_CLOSURES_HPP
|
#define PHOENIX_CLOSURES_HPP
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#include "boost/lambda/core.hpp"
|
#include "boost/lambda/core.hpp"
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
#ifndef BOOST_LAMBDA_CORE_HPP
|
#ifndef BOOST_LAMBDA_CORE_HPP
|
||||||
#define BOOST_LAMBDA_CORE_HPP
|
#define BOOST_LAMBDA_CORE_HPP
|
||||||
|
|
||||||
#include "boost/config.hpp"
|
|
||||||
|
|
||||||
#include "boost/type_traits/transform_traits.hpp"
|
#include "boost/type_traits/transform_traits.hpp"
|
||||||
#include "boost/type_traits/cv_traits.hpp"
|
#include "boost/type_traits/cv_traits.hpp"
|
||||||
|
|
||||||
@@ -68,9 +66,9 @@ namespace {
|
|||||||
boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type();
|
boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type();
|
||||||
boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type();
|
boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type();
|
||||||
|
|
||||||
boost::lambda::placeholder1_type& BOOST_ATTRIBUTE_UNUSED _1 = free1;
|
boost::lambda::placeholder1_type& _1 = free1;
|
||||||
boost::lambda::placeholder2_type& BOOST_ATTRIBUTE_UNUSED _2 = free2;
|
boost::lambda::placeholder2_type& _2 = free2;
|
||||||
boost::lambda::placeholder3_type& BOOST_ATTRIBUTE_UNUSED _3 = free3;
|
boost::lambda::placeholder3_type& _3 = free3;
|
||||||
// _1, _2, ... naming scheme by Peter Dimov
|
// _1, _2, ... naming scheme by Peter Dimov
|
||||||
} // unnamed
|
} // unnamed
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,13 @@
|
|||||||
# define BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
|
# define BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
|
||||||
# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
|
# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
|
||||||
# endif
|
# endif
|
||||||
|
# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
|
||||||
|
# define BOOST_NO_TEMPLATED_STREAMS
|
||||||
|
# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
|
||||||
|
# endif
|
||||||
|
# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 95)
|
||||||
|
# define BOOST_LAMBDA_FAILS_IN_TEMPLATE_KEYWORD_AFTER_SCOPE_OPER
|
||||||
|
# endif
|
||||||
# endif // __GNUC__
|
# endif // __GNUC__
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/utility/result_of.hpp>
|
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||||
|
|
||||||
@@ -298,38 +297,6 @@ public:
|
|||||||
} // namespace lambda
|
} // namespace lambda
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_DECLTYPE)
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct result_of<boost::lambda::lambda_functor<T>()>
|
|
||||||
{
|
|
||||||
typedef typename boost::lambda::lambda_functor<T>::nullary_return_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct result_of<const boost::lambda::lambda_functor<T>()>
|
|
||||||
{
|
|
||||||
typedef typename boost::lambda::lambda_functor<T>::nullary_return_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tr1_result_of<boost::lambda::lambda_functor<T>()>
|
|
||||||
{
|
|
||||||
typedef typename boost::lambda::lambda_functor<T>::nullary_return_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct tr1_result_of<const boost::lambda::lambda_functor<T>()>
|
|
||||||
{
|
|
||||||
typedef typename boost::lambda::lambda_functor<T>::nullary_return_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// is_placeholder
|
// is_placeholder
|
||||||
|
|
||||||
#include <boost/is_placeholder.hpp>
|
#include <boost/is_placeholder.hpp>
|
||||||
|
|||||||
@@ -282,11 +282,6 @@ struct const_copy_argument<void> {
|
|||||||
typedef void type;
|
typedef void type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
|
||||||
struct const_copy_argument<void const> {
|
|
||||||
typedef void type;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Does the same as const_copy_argument, but passes references through as such
|
// Does the same as const_copy_argument, but passes references through as such
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
@@ -12,13 +12,7 @@
|
|||||||
#define BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP
|
#define BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP
|
||||||
|
|
||||||
#include "boost/lambda/detail/is_instance_of.hpp"
|
#include "boost/lambda/detail/is_instance_of.hpp"
|
||||||
#include "boost/type_traits/is_same.hpp"
|
#include "boost/type_traits/same_traits.hpp"
|
||||||
#include "boost/type_traits/is_pointer.hpp"
|
|
||||||
#include "boost/type_traits/is_float.hpp"
|
|
||||||
#include "boost/type_traits/is_convertible.hpp"
|
|
||||||
#include "boost/type_traits/remove_pointer.hpp"
|
|
||||||
#include "boost/type_traits/remove_const.hpp"
|
|
||||||
#include "boost/type_traits/remove_reference.hpp"
|
|
||||||
|
|
||||||
#include "boost/indirect_reference.hpp"
|
#include "boost/indirect_reference.hpp"
|
||||||
#include "boost/detail/container_fwd.hpp"
|
#include "boost/detail/container_fwd.hpp"
|
||||||
@@ -542,6 +536,36 @@ struct return_type_2<bitwise_action<Act>, A, B>
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_TEMPLATED_STREAMS
|
||||||
|
|
||||||
|
template<class A, class B>
|
||||||
|
struct leftshift_type {
|
||||||
|
|
||||||
|
typedef typename detail::IF<
|
||||||
|
boost::is_convertible<
|
||||||
|
typename boost::remove_reference<A>::type*,
|
||||||
|
std::ostream*
|
||||||
|
>::value,
|
||||||
|
std::ostream&,
|
||||||
|
typename detail::remove_reference_and_cv<A>::type
|
||||||
|
>::RET type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class A, class B>
|
||||||
|
struct rightshift_type {
|
||||||
|
|
||||||
|
typedef typename detail::IF<
|
||||||
|
|
||||||
|
boost::is_convertible<
|
||||||
|
typename boost::remove_reference<A>::type*,
|
||||||
|
std::istream*
|
||||||
|
>::value,
|
||||||
|
std::istream&,
|
||||||
|
typename detail::remove_reference_and_cv<A>::type
|
||||||
|
>::RET type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template <class T> struct get_ostream_type {
|
template <class T> struct get_ostream_type {
|
||||||
typedef std::basic_ostream<typename T::char_type,
|
typedef std::basic_ostream<typename T::char_type,
|
||||||
@@ -578,6 +602,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end detail
|
} // end detail
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,23 @@ namespace detail {
|
|||||||
|
|
||||||
// Note that the overloading is const vs. non-const first argument
|
// Note that the overloading is const vs. non-const first argument
|
||||||
|
|
||||||
|
#ifdef BOOST_NO_TEMPLATED_STREAMS
|
||||||
|
template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
|
||||||
|
typedef typename detail::IF<
|
||||||
|
boost::is_convertible<T*, std::ostream*>::value,
|
||||||
|
T&,
|
||||||
|
typename const_copy_argument <T>::type
|
||||||
|
>::RET type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
|
||||||
|
typedef typename detail::IF<
|
||||||
|
boost::is_convertible<T*, std::istream*>::value,
|
||||||
|
T&,
|
||||||
|
typename const_copy_argument <T>::type
|
||||||
|
>::RET type;
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
|
||||||
template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
|
template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
|
||||||
typedef typename detail::IF<
|
typedef typename detail::IF<
|
||||||
@@ -181,6 +198,7 @@ template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
|
|||||||
typename const_copy_argument <T>::type
|
typename const_copy_argument <T>::type
|
||||||
>::RET type;
|
>::RET type;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
} // detail
|
} // detail
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ inline const
|
|||||||
lambda_functor<
|
lambda_functor<
|
||||||
lambda_functor_base<do_nothing_action, null_type>
|
lambda_functor_base<do_nothing_action, null_type>
|
||||||
>
|
>
|
||||||
make_void(const Arg1&) {
|
make_void(const Arg1& a1) {
|
||||||
return
|
return
|
||||||
lambda_functor_base<do_nothing_action, null_type>();
|
lambda_functor_base<do_nothing_action, null_type>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
namespace lambda {
|
namespace lambda {
|
||||||
|
|
||||||
|
using ::boost::type_traits::ice_and;
|
||||||
|
using ::boost::type_traits::ice_or;
|
||||||
|
using ::boost::type_traits::ice_not;
|
||||||
|
|
||||||
// Much of the type deduction code for standard arithmetic types
|
// Much of the type deduction code for standard arithmetic types
|
||||||
// from Gary Powell
|
// from Gary Powell
|
||||||
|
|
||||||
@@ -73,7 +77,8 @@ template <class Act, class A> struct return_type_1_prot {
|
|||||||
public:
|
public:
|
||||||
typedef typename
|
typedef typename
|
||||||
detail::IF<
|
detail::IF<
|
||||||
is_protectable<Act>::value && is_lambda_functor<A>::value,
|
// is_protectable<Act>::value && is_lambda_functor<A>::value,
|
||||||
|
ice_and<is_protectable<Act>::value, is_lambda_functor<A>::value>::value,
|
||||||
lambda_functor<
|
lambda_functor<
|
||||||
lambda_functor_base<
|
lambda_functor_base<
|
||||||
Act,
|
Act,
|
||||||
@@ -107,7 +112,9 @@ namespace detail {
|
|||||||
// add const to rvalues, so that all rvalues are stored as const in
|
// add const to rvalues, so that all rvalues are stored as const in
|
||||||
// the args tuple
|
// the args tuple
|
||||||
typedef typename detail::IF_type<
|
typedef typename detail::IF_type<
|
||||||
boost::is_reference<T>::value && !boost::is_const<non_ref_T>::value,
|
// boost::is_reference<T>::value && !boost::is_const<non_ref_T>::value,
|
||||||
|
ice_and<boost::is_reference<T>::value,
|
||||||
|
ice_not<boost::is_const<non_ref_T>::value>::value>::value,
|
||||||
detail::identity_mapping<T>,
|
detail::identity_mapping<T>,
|
||||||
const_copy_argument<non_ref_T> // handles funtion and array
|
const_copy_argument<non_ref_T> // handles funtion and array
|
||||||
>::type type; // types correctly
|
>::type type; // types correctly
|
||||||
@@ -141,8 +148,11 @@ template <class Act, class A, class B> struct return_type_2_prot {
|
|||||||
|
|
||||||
typedef typename
|
typedef typename
|
||||||
detail::IF<
|
detail::IF<
|
||||||
is_protectable<Act>::value &&
|
// is_protectable<Act>::value &&
|
||||||
(is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
// (is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
||||||
|
ice_and<is_protectable<Act>::value,
|
||||||
|
ice_or<is_lambda_functor<A>::value,
|
||||||
|
is_lambda_functor<B>::value>::value>::value,
|
||||||
lambda_functor<
|
lambda_functor<
|
||||||
lambda_functor_base<
|
lambda_functor_base<
|
||||||
Act,
|
Act,
|
||||||
@@ -177,8 +187,11 @@ struct return_type_2_comma
|
|||||||
|
|
||||||
typedef typename
|
typedef typename
|
||||||
detail::IF<
|
detail::IF<
|
||||||
is_protectable<other_action<comma_action> >::value && // it is protectable
|
// is_protectable<other_action<comma_action> >::value && // it is protectable
|
||||||
(is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
// (is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
||||||
|
ice_and<is_protectable<other_action<comma_action> >::value, // it is protectable
|
||||||
|
ice_or<is_lambda_functor<A>::value,
|
||||||
|
is_lambda_functor<B>::value>::value>::value,
|
||||||
lambda_functor<
|
lambda_functor<
|
||||||
lambda_functor_base<
|
lambda_functor_base<
|
||||||
other_action<comma_action>,
|
other_action<comma_action>,
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef BOOST_LAMBDA_SUPPRESS_UNUSED_HPP
|
#ifndef BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||||
#define BOOST_LAMBDA_SUPPRESS_UNUSED_HPP
|
#define BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace lambda {
|
namespace lambda {
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ public:
|
|||||||
// is true, the true_statement (again an lambda_functor) is executed
|
// is true, the true_statement (again an lambda_functor) is executed
|
||||||
// otherwise, the false_statement (another lambda_functor) is executed. The
|
// otherwise, the false_statement (another lambda_functor) is executed. The
|
||||||
// result type of this is void. Note the trailing underscore after
|
// result type of this is void. Note the trailing underscore after
|
||||||
// if_ and the leading dot and the trailing underscore before
|
// if_ and the the leading dot and the trailing underscore before
|
||||||
// and after .else_.
|
// and after .else_.
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "boost/lambda/detail/operators.hpp"
|
#include "boost/lambda/detail/operators.hpp"
|
||||||
|
|
||||||
|
#ifndef BOOST_LAMBDA_FAILS_IN_TEMPLATE_KEYWORD_AFTER_SCOPE_OPER
|
||||||
|
// sorry, member ptr does not work with gcc2.95
|
||||||
#include "boost/lambda/detail/member_ptr.hpp"
|
#include "boost/lambda/detail/member_ptr.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ while_(CondT const& cond)
|
|||||||
// While the condition (an lambda_functor) evaluates to true, statement
|
// While the condition (an lambda_functor) evaluates to true, statement
|
||||||
// (another lambda_functor) is executed. The statement is executed at least
|
// (another lambda_functor) is executed. The statement is executed at least
|
||||||
// once. The result type of this is void. Note the trailing
|
// once. The result type of this is void. Note the trailing
|
||||||
// underscore after do_ and the leading dot and the trailing
|
// underscore after do_ and the the leading dot and the trailing
|
||||||
// underscore before and after .while_.
|
// underscore before and after .while_.
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"key": "lambda",
|
|
||||||
"name": "Lambda",
|
|
||||||
"authors": [
|
|
||||||
"Jaakko Järvi",
|
|
||||||
"Gary Powell"
|
|
||||||
],
|
|
||||||
"description": "Define small unnamed function objects at the actual call site, and more.",
|
|
||||||
"category": [
|
|
||||||
"Function-objects"
|
|
||||||
],
|
|
||||||
"maintainers": [
|
|
||||||
"Jaakko Jarvi <jarvi -at- cs.tamu.edu>"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -121,16 +121,8 @@ void test_unlambda() {
|
|||||||
|
|
||||||
BOOST_CHECK(call_with_101(_1 + 1) == 102);
|
BOOST_CHECK(call_with_101(_1 + 1) == 102);
|
||||||
|
|
||||||
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
|
||||||
|
|
||||||
BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
|
BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind(std::plus<int>(), 1, std::placeholders::_1)), _1)) == 101);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// std_functor insturcts LL that the functor defines a result_type typedef
|
// std_functor insturcts LL that the functor defines a result_type typedef
|
||||||
// rather than a sig template.
|
// rather than a sig template.
|
||||||
bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
|
bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
|
||||||
|
|||||||
@@ -299,9 +299,8 @@ int test_main(int, char *[]) {
|
|||||||
BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight), var(nine))() == 9);
|
BOOST_CHECK(boost::lambda::bind(with_result_template_reference(), var(one), var(two), var(three), var(four), var(five), var(six), var(seven), var(eight), var(nine))() == 9);
|
||||||
|
|
||||||
// Check using result_of with lambda functors
|
// Check using result_of with lambda functors
|
||||||
BOOST_CHECK(apply0(constant(0)) == 0);
|
//BOOST_CHECK(apply0(constant(0)) == 0);
|
||||||
// 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<int&>(_1, one) == 1);
|
BOOST_CHECK(apply1<int&>(_1, one) == 1);
|
||||||
BOOST_CHECK(apply1<const int&>(_1, one) == 1);
|
BOOST_CHECK(apply1<const int&>(_1, one) == 1);
|
||||||
BOOST_CHECK((apply2<int, int>(_1 + _2, one, two) == 3));
|
BOOST_CHECK((apply2<int, int>(_1 + _2, one, two) == 3));
|
||||||
|
|||||||
Reference in New Issue
Block a user