mirror of
https://github.com/boostorg/lambda.git
synced 2026-01-21 04:52:25 +00:00
Compare commits
90 Commits
boost-1.44
...
boost-1.71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8824e81d52 | ||
|
|
6395013860 | ||
|
|
8c0410fff5 | ||
|
|
b8a2f400ac | ||
|
|
4fc4454f3e | ||
|
|
02999cca47 | ||
|
|
e8eda93ef0 | ||
|
|
9d171774af | ||
|
|
f4b5e00a4f | ||
|
|
42b499ec9b | ||
|
|
61119a8e37 | ||
|
|
4b00716f5f | ||
|
|
4baf512ed2 | ||
|
|
4c0ef8e469 | ||
|
|
18bc9b84cb | ||
|
|
ad5673c9de | ||
|
|
8d9106ab17 | ||
|
|
f12bd0ef93 | ||
|
|
b788075b6d | ||
|
|
5508ede384 | ||
|
|
e4b5434e27 | ||
|
|
4c4387a277 | ||
|
|
0f44d72275 | ||
|
|
723485bfa7 | ||
|
|
f85d2f0025 | ||
|
|
45c391b380 | ||
|
|
69482a3b49 | ||
|
|
0afac59bc1 | ||
|
|
5a6ae7f79d | ||
|
|
9a581dafb7 | ||
|
|
5e574813a2 | ||
|
|
11a6698eec | ||
|
|
5ba2e0aa6a | ||
|
|
59e1516609 | ||
|
|
fba5d5e822 | ||
|
|
635d0fb6ce | ||
|
|
ba8e62af76 | ||
|
|
545b6af540 | ||
|
|
ce6b030b06 | ||
|
|
ecf547cbef | ||
|
|
aef7c9fe51 | ||
|
|
677be04dd7 | ||
|
|
7d1d0d4fdd | ||
|
|
7d21ea7cbb | ||
|
|
0d069c2c0c | ||
|
|
25d6c0e3b1 | ||
|
|
4545234f94 | ||
|
|
657a0b9dd7 | ||
|
|
fab5a8041b | ||
|
|
55cd962166 | ||
|
|
9c376db7e5 | ||
|
|
3caa685662 | ||
|
|
2ed8d7f4df | ||
|
|
4091f55a4b | ||
|
|
45c6ba535c | ||
|
|
57a605d7cc | ||
|
|
fcfcc42baf | ||
|
|
c516504670 | ||
|
|
c479b3b7b7 | ||
|
|
269ac93b1b | ||
|
|
15d4e6ab79 | ||
|
|
77495bb7e1 | ||
|
|
c183b699bc | ||
|
|
3d4a3e7050 | ||
|
|
c14095472e | ||
|
|
1afc4b6779 | ||
|
|
41eb864595 | ||
|
|
0f60055086 | ||
|
|
9a8e5d7784 | ||
|
|
6985fca6ee | ||
|
|
04ae944c3c | ||
|
|
0c4e251ebe | ||
|
|
0faeb3f19e | ||
|
|
150736273e | ||
|
|
d5a98758fa | ||
|
|
cd3d5fd03a | ||
|
|
48a89b7705 | ||
|
|
ec350abf06 | ||
|
|
d56abd61ce | ||
|
|
2788ede42a | ||
|
|
1c953ed38c | ||
|
|
b2dc95bb18 | ||
|
|
797b5756cf | ||
|
|
bd4da55f0f | ||
|
|
47bf3df0ae | ||
|
|
ff0929e6e3 | ||
|
|
9b925abaff | ||
|
|
bf50f2fe7f | ||
|
|
85630d55a6 | ||
|
|
2e8c4eb8f3 |
40
.travis.yml
Normal file
40
.travis.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
# Copyright 2016 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)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 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
|
||||
- ./bootstrap.sh
|
||||
- ./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
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
||||
36
appveyor.yml
Normal file
36
appveyor.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
# 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
|
||||
- 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 boost/doc ;
|
||||
project lambda/doc ;
|
||||
import boostbook : boostbook ;
|
||||
|
||||
# Are these really the correct images??
|
||||
@@ -10,3 +10,12 @@ boostbook lambda-doc : lambda.xml
|
||||
<format>pdf:<xsl:param>img.src.path=$(images)/
|
||||
;
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc
|
||||
: lambda.xml
|
||||
:
|
||||
:
|
||||
: ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease ;
|
||||
explicit boostrelease ;
|
||||
|
||||
2
doc/detail/lambda_doc.xml
Executable file → Normal file
2
doc/detail/lambda_doc.xml
Executable file → Normal file
@@ -3435,7 +3435,7 @@ was dropped.
|
||||
<firstname>Brian</firstname>
|
||||
<surname>McNamara</surname>
|
||||
</author>
|
||||
<bibliomisc><ulink url="http://www.cc.gatech.edu/~yannis/fc++/">www.cc.gatech.edu/~yannis/fc++/</ulink>
|
||||
<bibliomisc><ulink url="http://yanniss.github.io/fc++/">yanniss.github.io/fc++/ </ulink>
|
||||
</bibliomisc>
|
||||
<pubdate>2002</pubdate>
|
||||
</biblioentry>
|
||||
|
||||
@@ -3440,7 +3440,7 @@ was dropped.
|
||||
<firstname>Brian</firstname>
|
||||
<surname>McNamara</surname>
|
||||
</author>
|
||||
<bibliomisc><ulink url="http://www.cc.gatech.edu/~yannis/fc++/">www.cc.gatech.edu/~yannis/fc++/</ulink>
|
||||
<bibliomisc><ulink url="http://yanniss.github.io/fc++/">yanniss.github.io/fc++/ </ulink>
|
||||
</bibliomisc>
|
||||
<pubdate>2002</pubdate>
|
||||
</biblioentry>
|
||||
|
||||
@@ -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 ---------------------------------
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#ifndef BOOST_LAMBDA_CORE_HPP
|
||||
#define BOOST_LAMBDA_CORE_HPP
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
#include "boost/type_traits/transform_traits.hpp"
|
||||
#include "boost/type_traits/cv_traits.hpp"
|
||||
|
||||
@@ -66,9 +68,9 @@ namespace {
|
||||
boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type();
|
||||
boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type();
|
||||
|
||||
boost::lambda::placeholder1_type& _1 = free1;
|
||||
boost::lambda::placeholder2_type& _2 = free2;
|
||||
boost::lambda::placeholder3_type& _3 = free3;
|
||||
boost::lambda::placeholder1_type& BOOST_ATTRIBUTE_UNUSED _1 = free1;
|
||||
boost::lambda::placeholder2_type& BOOST_ATTRIBUTE_UNUSED _2 = free2;
|
||||
boost::lambda::placeholder3_type& BOOST_ATTRIBUTE_UNUSED _3 = free3;
|
||||
// _1, _2, ... naming scheme by Peter Dimov
|
||||
} // unnamed
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "boost/tuple/tuple.hpp"
|
||||
#include "boost/type_traits/same_traits.hpp"
|
||||
#include "boost/type_traits/remove_reference.hpp"
|
||||
#include "boost/type_traits/remove_cv.hpp"
|
||||
#include "boost/type_traits/add_const.hpp"
|
||||
#include "boost/type_traits/add_volatile.hpp"
|
||||
#include "boost/utility/result_of.hpp"
|
||||
|
||||
namespace boost {
|
||||
@@ -237,22 +240,26 @@ struct function_adaptor<T Object::*> {
|
||||
// the data member is accessed is const, and finally adding a reference
|
||||
template<class Args> class sig {
|
||||
typedef typename boost::tuples::element<1, Args>::type argument_type;
|
||||
typedef typename boost::remove_reference<
|
||||
argument_type
|
||||
>::type unref_type;
|
||||
|
||||
typedef typename detail::IF<boost::is_const<argument_type>::value,
|
||||
typedef typename detail::IF<boost::is_const<unref_type>::value,
|
||||
typename boost::add_const<T>::type,
|
||||
T
|
||||
>::RET properly_consted_return_type;
|
||||
|
||||
typedef typename detail::IF<
|
||||
boost::is_volatile<properly_consted_return_type>::value,
|
||||
typedef typename detail::IF<boost::is_volatile<unref_type>::value,
|
||||
typename boost::add_volatile<properly_consted_return_type>::type,
|
||||
properly_consted_return_type
|
||||
>::RET properly_cvd_return_type;
|
||||
|
||||
|
||||
public:
|
||||
typedef typename
|
||||
boost::add_reference<properly_cvd_return_type>::type type;
|
||||
typedef typename detail::IF<boost::is_reference<argument_type>::value,
|
||||
typename boost::add_reference<properly_cvd_return_type>::type,
|
||||
typename boost::remove_cv<T>::type
|
||||
>::RET type;
|
||||
};
|
||||
|
||||
template <class RET>
|
||||
|
||||
@@ -22,13 +22,6 @@
|
||||
# define BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
|
||||
# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
|
||||
# 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__
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
|
||||
@@ -297,6 +298,38 @@ public:
|
||||
} // namespace lambda
|
||||
} // 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
|
||||
|
||||
#include <boost/is_placeholder.hpp>
|
||||
|
||||
@@ -282,6 +282,11 @@ struct const_copy_argument<void> {
|
||||
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
|
||||
template<class T>
|
||||
|
||||
@@ -12,7 +12,13 @@
|
||||
#define BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP
|
||||
|
||||
#include "boost/lambda/detail/is_instance_of.hpp"
|
||||
#include "boost/type_traits/same_traits.hpp"
|
||||
#include "boost/type_traits/is_same.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/detail/container_fwd.hpp"
|
||||
@@ -536,36 +542,6 @@ struct return_type_2<bitwise_action<Act>, A, B>
|
||||
|
||||
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 {
|
||||
typedef std::basic_ostream<typename T::char_type,
|
||||
@@ -602,7 +578,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
} // end detail
|
||||
|
||||
|
||||
@@ -161,23 +161,6 @@ namespace detail {
|
||||
|
||||
// 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 {
|
||||
typedef typename detail::IF<
|
||||
@@ -198,7 +181,6 @@ template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
|
||||
typename const_copy_argument <T>::type
|
||||
>::RET type;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // detail
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ inline const
|
||||
lambda_functor<
|
||||
lambda_functor_base<do_nothing_action, null_type>
|
||||
>
|
||||
make_void(const Arg1& a1) {
|
||||
make_void(const Arg1&) {
|
||||
return
|
||||
lambda_functor_base<do_nothing_action, null_type>();
|
||||
}
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
namespace boost {
|
||||
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
|
||||
// from Gary Powell
|
||||
|
||||
@@ -77,8 +73,7 @@ template <class Act, class A> struct return_type_1_prot {
|
||||
public:
|
||||
typedef typename
|
||||
detail::IF<
|
||||
// is_protectable<Act>::value && is_lambda_functor<A>::value,
|
||||
ice_and<is_protectable<Act>::value, is_lambda_functor<A>::value>::value,
|
||||
is_protectable<Act>::value && is_lambda_functor<A>::value,
|
||||
lambda_functor<
|
||||
lambda_functor_base<
|
||||
Act,
|
||||
@@ -112,9 +107,7 @@ namespace detail {
|
||||
// add const to rvalues, so that all rvalues are stored as const in
|
||||
// the args tuple
|
||||
typedef typename detail::IF_type<
|
||||
// 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,
|
||||
boost::is_reference<T>::value && !boost::is_const<non_ref_T>::value,
|
||||
detail::identity_mapping<T>,
|
||||
const_copy_argument<non_ref_T> // handles funtion and array
|
||||
>::type type; // types correctly
|
||||
@@ -148,11 +141,8 @@ template <class Act, class A, class B> struct return_type_2_prot {
|
||||
|
||||
typedef typename
|
||||
detail::IF<
|
||||
// is_protectable<Act>::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,
|
||||
is_protectable<Act>::value &&
|
||||
(is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
||||
lambda_functor<
|
||||
lambda_functor_base<
|
||||
Act,
|
||||
@@ -187,11 +177,8 @@ struct return_type_2_comma
|
||||
|
||||
typedef typename
|
||||
detail::IF<
|
||||
// is_protectable<other_action<comma_action> >::value && // it is protectable
|
||||
// (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,
|
||||
is_protectable<other_action<comma_action> >::value && // it is protectable
|
||||
(is_lambda_functor<A>::value || is_lambda_functor<B>::value),
|
||||
lambda_functor<
|
||||
lambda_functor_base<
|
||||
other_action<comma_action>,
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||
#define BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||
#ifndef BOOST_LAMBDA_SUPPRESS_UNUSED_HPP
|
||||
#define BOOST_LAMBDA_SUPPRESS_UNUSED_HPP
|
||||
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
// is true, the true_statement (again an lambda_functor) is executed
|
||||
// otherwise, the false_statement (another lambda_functor) is executed. The
|
||||
// result type of this is void. Note the trailing underscore after
|
||||
// if_ and the the leading dot and the trailing underscore before
|
||||
// if_ and the leading dot and the trailing underscore before
|
||||
// and after .else_.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
|
||||
|
||||
#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"
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -348,7 +348,7 @@ while_(CondT const& cond)
|
||||
// While the condition (an lambda_functor) evaluates to true, statement
|
||||
// (another lambda_functor) is executed. The statement is executed at least
|
||||
// once. The result type of this is void. Note the trailing
|
||||
// underscore after do_ and the the leading dot and the trailing
|
||||
// underscore after do_ and the leading dot and the trailing
|
||||
// underscore before and after .while_.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
15
meta/libraries.json
Normal file
15
meta/libraries.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"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>"
|
||||
]
|
||||
}
|
||||
0
test/Makefile
Executable file → Normal file
0
test/Makefile
Executable file → Normal file
@@ -121,8 +121,16 @@ void test_unlambda() {
|
||||
|
||||
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);
|
||||
|
||||
#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
|
||||
// rather than a sig template.
|
||||
bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
|
||||
|
||||
@@ -80,6 +80,23 @@ void test_member_functions()
|
||||
// bind(&A::add, a, _1);
|
||||
}
|
||||
|
||||
struct B {
|
||||
B(int n) : i(n) {};
|
||||
int i;
|
||||
};
|
||||
|
||||
void test_data_members()
|
||||
{
|
||||
using boost::ref;
|
||||
B b(10);
|
||||
BOOST_CHECK(bind(&B::i, ref(b))() == 10);
|
||||
BOOST_CHECK(bind(&B::i, b)() == 10);
|
||||
BOOST_CHECK(bind(&B::i, _1)(b) == 10);
|
||||
BOOST_CHECK(bind(&B::i, _1)(B(11)) == 11);
|
||||
bind(&B::i, ref(b))() = 1;
|
||||
BOOST_CHECK(b.i == 1);
|
||||
}
|
||||
|
||||
int test_main(int, char *[]) {
|
||||
|
||||
int i = 1; int j = 2; int k = 3;
|
||||
|
||||
@@ -299,7 +299,7 @@ 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);
|
||||
|
||||
// Check using result_of with lambda functors
|
||||
//BOOST_CHECK(apply0(constant(0)) == 0);
|
||||
BOOST_CHECK(apply0(constant(0)) == 0);
|
||||
BOOST_CHECK(apply1<int>(_1, one) == 1);
|
||||
BOOST_CHECK(apply1<int&>(_1, one) == 1);
|
||||
BOOST_CHECK(apply1<const int&>(_1, one) == 1);
|
||||
|
||||
Reference in New Issue
Block a user