mirror of
https://github.com/boostorg/lambda.git
synced 2026-01-21 04:52:25 +00:00
Compare commits
24 Commits
boost-1.54
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8425389a93 | ||
|
|
0f60055086 | ||
|
|
9a8e5d7784 | ||
|
|
6985fca6ee | ||
|
|
04ae944c3c | ||
|
|
0c4e251ebe | ||
|
|
0faeb3f19e | ||
|
|
150736273e | ||
|
|
d5a98758fa | ||
|
|
cd3d5fd03a | ||
|
|
48a89b7705 | ||
|
|
ec350abf06 | ||
|
|
d56abd61ce | ||
|
|
2788ede42a | ||
|
|
1c953ed38c | ||
|
|
b2dc95bb18 | ||
|
|
797b5756cf | ||
|
|
bd4da55f0f | ||
|
|
47bf3df0ae | ||
|
|
ff0929e6e3 | ||
|
|
9b925abaff | ||
|
|
bf50f2fe7f | ||
|
|
85630d55a6 | ||
|
|
2e8c4eb8f3 |
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
lambda
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
lambda
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
# DOCDIRS
|
||||
# DESCRIPTION
|
||||
MODULARIZED
|
||||
# AUTHORS
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
project boost/doc ;
|
||||
import boostbook : boostbook ;
|
||||
|
||||
boostbook lambda-doc : lambda.xml ;
|
||||
# Are these really the correct images??
|
||||
path-constant images : ../../spirit/phoenix/doc/html ;
|
||||
|
||||
boostbook lambda-doc : lambda.xml
|
||||
:
|
||||
<format>pdf:<xsl:param>img.src.path=$(images)/
|
||||
;
|
||||
|
||||
|
||||
4
doc/detail/lambda_doc.xml
Executable file → Normal file
4
doc/detail/lambda_doc.xml
Executable file → Normal file
@@ -163,8 +163,8 @@ The STL contains predefined function objects for some common cases (such as <lit
|
||||
As an example, one possible implementation for the standard <literal>plus</literal> template is:
|
||||
|
||||
<programlisting>
|
||||
<![CDATA[template <class T> : public binary_function<T, T, T>
|
||||
struct plus {
|
||||
<![CDATA[template <class T>
|
||||
struct plus : public binary_function<T, T, T> {
|
||||
T operator()(const T& i, const T& j) const {
|
||||
return i + j;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
<meta http-equiv="refresh" content="0; URL=../../../doc/html/lambda.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to <a href="../../../doc/html/lambda.html">www.boost.org/doc/html/lambda.html</a>
|
||||
Automatic redirection failed, please go to <a href="../../../doc/html/lambda.html">www.boost.org/doc/html/lambda.html</a> <hr>
|
||||
<p>© Copyright Beman Dawes, 2001</p>
|
||||
<p>Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file <a href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy
|
||||
at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</p>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<para>
|
||||
|
||||
The Boost Lambda Library (BLL in the sequel) is a C++ template
|
||||
library, which implements form of <emphasis>lambda abstractions</emphasis> for C++.
|
||||
library, which implements a form of <emphasis>lambda abstractions</emphasis> for C++.
|
||||
The term originates from functional programming and lambda calculus, where a lambda abstraction defines an unnamed function.
|
||||
The primary motivation for the BLL is to provide flexible and
|
||||
convenient means to define unnamed function objects for STL algorithms.
|
||||
@@ -1908,7 +1908,7 @@ For example:
|
||||
int foo(int); int bar(int);
|
||||
...
|
||||
int i;
|
||||
bind(foo, bind(bar, _1)(i);
|
||||
bind(foo, bind(bar, _1))(i);
|
||||
</programlisting>
|
||||
|
||||
The last line makes the call <literal>foo(bar(i));</literal>
|
||||
@@ -2640,6 +2640,7 @@ which require that the argument types are references.
|
||||
<row><entry><literal><![CDATA[&]]></literal></entry><entry><literal><![CDATA[other_action<address_of_action>]]></literal></entry></row>
|
||||
<row><entry><literal><![CDATA[*]]></literal></entry><entry><literal><![CDATA[other_action<contents_of_action>]]></literal></entry></row>
|
||||
<row><entry><literal><![CDATA[,]]></literal></entry><entry><literal><![CDATA[other_action<comma_action>]]></literal></entry></row>
|
||||
<row><entry><literal><![CDATA[->*]]></literal></entry><entry><literal><![CDATA[other_action<member_pointer_action>]]></literal></entry></row>
|
||||
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -3190,7 +3191,7 @@ to extend the library with new features.
|
||||
|
||||
|
||||
|
||||
<appendix>
|
||||
<section>
|
||||
<title>Rationale for some of the design decisions</title>
|
||||
|
||||
<section id="lambda.why_weak_arity">
|
||||
@@ -3255,7 +3256,7 @@ was dropped.
|
||||
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// -- algorithm.hpp -- Boost Lambda Library -----------------------------------
|
||||
// Copyright (C) 2002 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2002 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2002 Gary Powell (gwpowell@hotmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- bind.hpp -- Boost Lambda Library --------------------------------------
|
||||
|
||||
// Copyright (C) 1999-2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999-2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Gary Powell (gwpowell@hotmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// - casts.hpp -- BLambda Library -------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -14,6 +14,8 @@
|
||||
#if !defined(BOOST_LAMBDA_CASTS_HPP)
|
||||
#define BOOST_LAMBDA_CASTS_HPP
|
||||
|
||||
#include "boost/lambda/detail/suppress_unused.hpp"
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost {
|
||||
@@ -64,11 +66,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// typedid action
|
||||
// typeid action
|
||||
class typeid_action {
|
||||
public:
|
||||
template<class RET, class Arg1>
|
||||
static RET apply(Arg1 &a1) {
|
||||
detail::suppress_unused_variable_warnings(a1);
|
||||
return typeid(a1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// - construct.hpp -- Lambda Library -------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// -- control_structures.hpp -- Boost Lambda Library --------------------------
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// -- core.hpp -- Boost Lambda Library -------------------------------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- Boost Lambda Library - actions.hpp ----------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- Boost Lambda Library -------------------------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- bind_functions.hpp -- Boost Lambda Library
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library -- control_constructs_common.hpp -------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library -- control_structures_impl.hpp ---------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - function_adaptors.hpp ----------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - is_instance_of.hpp ---------------------
|
||||
|
||||
// Copyright (C) 2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - lambda_config.hpp ------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library lambda_functor_base.hpp -----------------------------
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -16,6 +16,10 @@
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4512) //assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
// for return type deductions we wrap bound argument to this class,
|
||||
// which fulfils the base class contract for lambda_functors
|
||||
@@ -42,6 +46,10 @@ public:
|
||||
RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; }
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline lambda_functor<identity<T&> > var(T& t) { return identity<T&>(t); }
|
||||
|
||||
@@ -337,7 +345,7 @@ class lambda_functor_base<action<0, Act>, Args>
|
||||
{
|
||||
public:
|
||||
// Args args; not needed
|
||||
explicit lambda_functor_base(const Args& a) {}
|
||||
explicit lambda_functor_base(const Args& /*a*/) {}
|
||||
|
||||
template<class SigArgs> struct sig {
|
||||
typedef typename return_type_N<Act, null_type>::type type;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - lambda_functors.hpp -------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -13,6 +13,30 @@
|
||||
#ifndef BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
|
||||
#define BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1)\
|
||||
typename lazy_disable_if<is_array<A1>, typename R1 >::type
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) \
|
||||
typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2> >, typename R1, R2 >::type
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) \
|
||||
typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2>, is_array<A3> >, typename R1, R2, R3 >::type
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1) typename R1::type
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) typename R1, R2::type
|
||||
#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) typename R1, R2, R3::type
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
|
||||
@@ -105,7 +129,10 @@ typedef const lambda_functor<placeholder<THIRD> > placeholder3_type;
|
||||
// other lambda_functors.
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4512) //assignment operator could not be generated
|
||||
#endif
|
||||
|
||||
// -- lambda_functor NONE ------------------------------------------------
|
||||
template <class T>
|
||||
@@ -148,6 +175,14 @@ public:
|
||||
>(a, cnull_type(), cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A>
|
||||
BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig<tuple<A const&> >)
|
||||
operator()(A const& a) const {
|
||||
return inherited::template call<
|
||||
typename inherited::template sig<tuple<A const&> >::type
|
||||
>(a, cnull_type(), cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B>
|
||||
typename inherited::template sig<tuple<A&, B&> >::type
|
||||
operator()(A& a, B& b) const {
|
||||
@@ -156,6 +191,30 @@ public:
|
||||
>(a, b, cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B>
|
||||
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B&> >)
|
||||
operator()(A const& a, B& b) const {
|
||||
return inherited::template call<
|
||||
typename inherited::template sig<tuple<A const&, B&> >::type
|
||||
>(a, b, cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B>
|
||||
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A&, B const&> >)
|
||||
operator()(A& a, B const& b) const {
|
||||
return inherited::template call<
|
||||
typename inherited::template sig<tuple<A&, B const&> >::type
|
||||
>(a, b, cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B>
|
||||
BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B const&> >)
|
||||
operator()(A const& a, B const& b) const {
|
||||
return inherited::template call<
|
||||
typename inherited::template sig<tuple<A const&, B const&> >::type
|
||||
>(a, b, cnull_type(), cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B, class C>
|
||||
typename inherited::template sig<tuple<A&, B&, C&> >::type
|
||||
operator()(A& a, B& b, C& c) const
|
||||
@@ -165,6 +224,15 @@ public:
|
||||
>(a, b, c, cnull_type());
|
||||
}
|
||||
|
||||
template<class A, class B, class C>
|
||||
BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template sig<tuple<A const&, B const&, C const&> >)
|
||||
operator()(A const& a, B const& b, C const& c) const
|
||||
{
|
||||
return inherited::template call<
|
||||
typename inherited::template sig<tuple<A const&, B const&, C const&> >::type
|
||||
>(a, b, c, cnull_type());
|
||||
}
|
||||
|
||||
// for internal calls with env
|
||||
template<CALL_TEMPLATE_ARGS>
|
||||
typename inherited::template sig<tuple<CALL_REFERENCE_TYPES> >::type
|
||||
@@ -203,10 +271,35 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace lambda
|
||||
} // namespace boost
|
||||
|
||||
// is_placeholder
|
||||
|
||||
#include <boost/is_placeholder.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::FIRST> > >
|
||||
{
|
||||
enum _vt { value = 1 };
|
||||
};
|
||||
|
||||
template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::SECOND> > >
|
||||
{
|
||||
enum _vt { value = 2 };
|
||||
};
|
||||
|
||||
template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::THIRD> > >
|
||||
{
|
||||
enum _vt { value = 3 };
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// lambda_fwd.hpp - Boost Lambda Library -------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// - lambda_traits.hpp --- Boost Lambda Library ----------------------------
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -430,6 +430,56 @@ struct bind_traits<const volatile T[n]> {
|
||||
typedef const volatile T (&type)[n];
|
||||
};
|
||||
|
||||
template<class R>
|
||||
struct bind_traits<R()> {
|
||||
typedef R(&type)();
|
||||
};
|
||||
|
||||
template<class R, class Arg1>
|
||||
struct bind_traits<R(Arg1)> {
|
||||
typedef R(&type)(Arg1);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2>
|
||||
struct bind_traits<R(Arg1, Arg2)> {
|
||||
typedef R(&type)(Arg1, Arg2);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8);
|
||||
};
|
||||
|
||||
template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9>
|
||||
struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)> {
|
||||
typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9);
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct bind_traits<reference_wrapper<T> >{
|
||||
typedef T& type;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library -- member_ptr.hpp ---------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000 Gary Powell (gary.powell@sierra.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- operator_actions.hpp - Boost Lambda Library ----------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - operator_lambda_func_base.hpp -----------------
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// operator_return_type_traits.hpp -- Boost Lambda Library ------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -233,28 +233,31 @@ template <class A> struct contentsof_type<const A> {
|
||||
// the IF is because the A::reference in the primary template could
|
||||
// be some class type rather than a real reference, hence
|
||||
// we do not want to make it a reference here either
|
||||
typedef typename detail::IF<
|
||||
typedef typename boost::remove_reference<type1>::type no_reference;
|
||||
typedef typename detail::IF<
|
||||
is_reference<type1>::value,
|
||||
const typename boost::remove_reference<type1>::type &,
|
||||
const type1
|
||||
const no_reference &,
|
||||
const no_reference
|
||||
>::RET type;
|
||||
};
|
||||
|
||||
template <class A> struct contentsof_type<volatile A> {
|
||||
typedef typename contentsof_type<A>::type type1;
|
||||
typedef typename boost::remove_reference<type1>::type no_reference;
|
||||
typedef typename detail::IF<
|
||||
is_reference<type1>::value,
|
||||
volatile typename boost::remove_reference<type1>::type &,
|
||||
volatile type1
|
||||
volatile no_reference &,
|
||||
volatile no_reference
|
||||
>::RET type;
|
||||
};
|
||||
|
||||
template <class A> struct contentsof_type<const volatile A> {
|
||||
typedef typename contentsof_type<A>::type type1;
|
||||
typedef typename boost::remove_reference<type1>::type no_reference;
|
||||
typedef typename detail::IF<
|
||||
is_reference<type1>::value,
|
||||
const volatile typename boost::remove_reference<type1>::type &,
|
||||
const volatile type1
|
||||
const volatile no_reference &,
|
||||
const volatile no_reference
|
||||
>::RET type;
|
||||
};
|
||||
|
||||
@@ -859,7 +862,7 @@ struct return_type_2<other_action<subscript_action>, A, B> {
|
||||
|
||||
|
||||
// Forward declarations are incompatible with the libstdc++ debug mode.
|
||||
#if BOOST_WORKAROUND(__GNUC__, >= 3) && _GLIBCXX_DEBUG
|
||||
#if BOOST_WORKAROUND(__GNUC__, >= 3) && defined(_GLIBCXX_DEBUG)
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@@ -933,6 +936,41 @@ struct plain_return_type_2<other_action<subscript_action>, const std::basic_stri
|
||||
typedef typename std::basic_string<Char, Traits, Allocator>::const_reference type;
|
||||
};
|
||||
|
||||
template<class Char, class Traits, class Allocator>
|
||||
struct plain_return_type_2<arithmetic_action<plus_action>,
|
||||
std::basic_string<Char, Traits, Allocator>,
|
||||
std::basic_string<Char, Traits, Allocator> > {
|
||||
typedef std::basic_string<Char, Traits, Allocator> type;
|
||||
};
|
||||
|
||||
template<class Char, class Traits, class Allocator>
|
||||
struct plain_return_type_2<arithmetic_action<plus_action>,
|
||||
const Char*,
|
||||
std::basic_string<Char, Traits, Allocator> > {
|
||||
typedef std::basic_string<Char, Traits, Allocator> type;
|
||||
};
|
||||
|
||||
template<class Char, class Traits, class Allocator>
|
||||
struct plain_return_type_2<arithmetic_action<plus_action>,
|
||||
std::basic_string<Char, Traits, Allocator>,
|
||||
const Char*> {
|
||||
typedef std::basic_string<Char, Traits, Allocator> type;
|
||||
};
|
||||
|
||||
template<class Char, class Traits, class Allocator, std::size_t N>
|
||||
struct plain_return_type_2<arithmetic_action<plus_action>,
|
||||
Char[N],
|
||||
std::basic_string<Char, Traits, Allocator> > {
|
||||
typedef std::basic_string<Char, Traits, Allocator> type;
|
||||
};
|
||||
|
||||
template<class Char, class Traits, class Allocator, std::size_t N>
|
||||
struct plain_return_type_2<arithmetic_action<plus_action>,
|
||||
std::basic_string<Char, Traits, Allocator>,
|
||||
Char[N]> {
|
||||
typedef std::basic_string<Char, Traits, Allocator> type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace lambda
|
||||
} // namespace boost
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library - operators.hpp --------------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -258,17 +258,17 @@ operator>>(const lambda_functor<Arg>& a, Ret(&b)(ManipArg))
|
||||
#error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1"
|
||||
#endif
|
||||
|
||||
#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \
|
||||
#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \
|
||||
template<class Arg, int N, class B> \
|
||||
inline const \
|
||||
lambda_functor< \
|
||||
lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
|
||||
lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
|
||||
> \
|
||||
OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
|
||||
OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
|
||||
{ \
|
||||
return lambda_functor< \
|
||||
lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
|
||||
>(tuple<lambda_functor<Arg>, CONSTB(&)[N]>(a, b)); \
|
||||
return \
|
||||
lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
|
||||
(tuple<lambda_functor<Arg>, CONSTB(&)[N]>(a, b)); \
|
||||
}
|
||||
|
||||
|
||||
@@ -276,15 +276,15 @@ OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
|
||||
#error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2"
|
||||
#endif
|
||||
|
||||
#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \
|
||||
template<int N, class A, class Arg> \
|
||||
inline const \
|
||||
lambda_functor< \
|
||||
#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \
|
||||
template<int N, class A, class Arg> \
|
||||
inline const \
|
||||
lambda_functor< \
|
||||
lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
|
||||
> \
|
||||
> \
|
||||
OPER_NAME (CONSTA(&a)[N], const lambda_functor<Arg>& b) \
|
||||
{ \
|
||||
return \
|
||||
{ \
|
||||
return \
|
||||
lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
|
||||
(tuple<CONSTA(&)[N], lambda_functor<Arg> >(a, b)); \
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library ret.hpp -----------------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// return_type_traits.hpp -- Boost Lambda Library ---------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- select_functions.hpp -- Boost Lambda Library --------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
27
include/boost/lambda/detail/suppress_unused.hpp
Normal file
27
include/boost/lambda/detail/suppress_unused.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
// Boost Lambda Library suppress_unused.hpp -----------------------------
|
||||
//
|
||||
// Copyright (C) 2009 Steven Watanabe
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// For more information, see www.boost.org
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||
#define BOOST_LAMBDA_SUPRESS_UNUSED_HPP
|
||||
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
inline void suppress_unused_variable_warnings(const T&) {}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
// -- Boost Lambda Library -- exceptions.hpp ----------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (gwpowell@hotmail.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library -- if.hpp ------------------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 2001-2002 Joel de Guzman
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// -- lambda.hpp -- Boost Lambda Library -----------------------------------
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost Lambda Library -- loops.hpp ----------------------------------------
|
||||
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (c) 2001-2002 Joel de Guzman
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// -- numeric.hpp -- Boost Lambda Library -----------------------------------
|
||||
// Copyright (C) 2002 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2002 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2002 Gary Powell (gwpowell@hotmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost Lambda Library -- switch.hpp -----------------------------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -465,12 +465,18 @@ BOOST_LAMBDA_SWITCH( BOOST_PP_INC(N) )
|
||||
#define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER(z, N, A) \
|
||||
BOOST_LAMBDA_SWITCH_STATEMENT(BOOST_PP_INC(N))
|
||||
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4065)
|
||||
#endif
|
||||
|
||||
// up to 9 cases supported (counting default:)
|
||||
BOOST_PP_REPEAT_2ND(9,BOOST_LAMBDA_SWITCH_HELPER,FOO)
|
||||
BOOST_PP_REPEAT_2ND(9,BOOST_LAMBDA_SWITCH_STATEMENT_HELPER,FOO)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace lambda
|
||||
} // namespace boost
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
<meta http-equiv="refresh" content="0; URL=../../doc/html/lambda.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to <a href="../../doc/html/lambda.html">www.boost.org/doc/html/lambda.html</a>
|
||||
Automatic redirection failed, please go to <a href="../../doc/html/lambda.html">www.boost.org/doc/html/lambda.html</a> <hr>
|
||||
<p>© Copyright Beman Dawes, 2001</p>
|
||||
<p>Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy
|
||||
at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</p>
|
||||
</body>
|
||||
</html>
|
||||
1
module.cmake
Normal file
1
module.cmake
Normal file
@@ -0,0 +1 @@
|
||||
boost_module(lambda DEPENDS tuple)
|
||||
18
test/CMakeLists.txt
Normal file
18
test/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
boost_additional_test_dependencies(lambda BOOST_DEPENDS test any)
|
||||
|
||||
boost_test_run(algorithm_test DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(bind_tests_simple DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(bind_tests_advanced DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(bind_tests_simple_f_refs DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(bll_and_function DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(lambda_cast_test
|
||||
cast_test.cpp DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(constructor_tests DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(control_structures DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(exception_test DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(extending_rt_traits DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(is_instance_of_test DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(member_pointer_test DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(operator_tests_simple DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(phoenix_control_structures DEPENDS boost_test_exec_monitor)
|
||||
boost_test_run(switch_construct DEPENDS boost_test_exec_monitor)
|
||||
70
test/Jamfile
70
test/Jamfile
@@ -8,52 +8,26 @@
|
||||
|
||||
# For more information, see http://www.boost.org/
|
||||
|
||||
import testing ;
|
||||
|
||||
subproject libs/lambda/test ;
|
||||
|
||||
# bring in rules for testing
|
||||
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
|
||||
include testing.jam ;
|
||||
|
||||
# Make tests run by default.
|
||||
DEPENDS all : test ;
|
||||
|
||||
{
|
||||
# look in BOOST_ROOT for sources first, just in this Jamfile
|
||||
local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
|
||||
|
||||
test-suite lambda
|
||||
:
|
||||
[ run libs/lambda/test/algorithm_test.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/bind_tests_simple.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/bind_tests_advanced.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/bind_tests_simple_f_refs.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/bll_and_function.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/cast_test.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/constructor_tests.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/control_structures.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/exception_test.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/extending_rt_traits.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/is_instance_of_test.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/member_pointer_test.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/operator_tests_simple.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/phoenix_control_structures.cpp : : : : ]
|
||||
|
||||
[ run libs/lambda/test/switch_construct.cpp : : : : ]
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
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 ]
|
||||
;
|
||||
|
||||
0
test/Makefile
Executable file → Normal file
0
test/Makefile
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
// bll_and_function.cpp - The Boost Lambda Library -----------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// bind_tests_advanced.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -27,7 +27,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
using namespace boost::lambda;
|
||||
using namespace boost::lambda;
|
||||
namespace bl = boost::lambda;
|
||||
|
||||
int sum_0() { return 0; }
|
||||
int sum_1(int a) { return a; }
|
||||
@@ -91,7 +92,7 @@ int call_with_100(const F& f) {
|
||||
// This would result in;
|
||||
// bind(_1 + 1, _1)(make_const(100)) , which would be a compile time error
|
||||
|
||||
return bind(unlambda(f), _1)(make_const(100));
|
||||
return bl::bind(unlambda(f), _1)(make_const(100));
|
||||
|
||||
// for other functors than lambda functors, unlambda has no effect
|
||||
// (except for making them const)
|
||||
@@ -116,11 +117,11 @@ void test_unlambda() {
|
||||
|
||||
BOOST_CHECK(call_with_101(_1 + 1) == 102);
|
||||
|
||||
BOOST_CHECK(call_with_100(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);
|
||||
|
||||
// std_functor insturcts LL that the functor defines a result_type typedef
|
||||
// rather than a sig template.
|
||||
bind(std_functor(std::plus<int>()), _1, _2)(i, i);
|
||||
bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// bind_tests_simple.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -18,9 +18,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::lambda;
|
||||
using namespace boost::lambda;
|
||||
|
||||
|
||||
int sum_of_args_0() { return 0; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// bind_tests_simple.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -18,9 +18,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::lambda;
|
||||
using namespace boost::lambda;
|
||||
|
||||
|
||||
int sum_of_args_0() { return 0; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// bll_and_function.cpp - The Boost Lambda Library -----------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// cast_tests.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// constructor_tests.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -24,8 +24,12 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4512)
|
||||
#endif
|
||||
|
||||
using namespace boost::lambda;
|
||||
using namespace std;
|
||||
namespace bl = boost::lambda;
|
||||
|
||||
template<class T>
|
||||
bool check_tuple(int n, const T& t)
|
||||
@@ -34,7 +38,7 @@ bool check_tuple(int n, const T& t)
|
||||
}
|
||||
|
||||
template <>
|
||||
bool check_tuple(int n, const null_type& ) { return true; }
|
||||
bool check_tuple(int /*n*/, const null_type& ) { return true; }
|
||||
|
||||
|
||||
void constructor_all_lengths()
|
||||
@@ -183,7 +187,7 @@ public:
|
||||
void test_destructor ()
|
||||
{
|
||||
char space[sizeof(is_destructor_called)];
|
||||
bool flag;
|
||||
bool flag = false;
|
||||
|
||||
is_destructor_called* idc = new(space) is_destructor_called(flag);
|
||||
BOOST_CHECK(flag == false);
|
||||
@@ -208,17 +212,17 @@ int count_deletes::count = 0;
|
||||
void test_news_and_deletes ()
|
||||
{
|
||||
int* i[10];
|
||||
for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
|
||||
std::for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
|
||||
int count_errors = 0;
|
||||
|
||||
for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
|
||||
std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
|
||||
BOOST_CHECK(count_errors == 0);
|
||||
|
||||
|
||||
count_deletes* ct[10];
|
||||
for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
|
||||
std::for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
|
||||
count_deletes::count = 0;
|
||||
for_each(ct, ct+10, bind(delete_ptr(), _1));
|
||||
std::for_each(ct, ct+10, bind(delete_ptr(), _1));
|
||||
BOOST_CHECK(count_deletes::count == 10);
|
||||
|
||||
}
|
||||
@@ -236,16 +240,16 @@ void test_array_new_and_delete()
|
||||
|
||||
void delayed_construction()
|
||||
{
|
||||
vector<int> x(3);
|
||||
vector<int> y(3);
|
||||
std::vector<int> x(3);
|
||||
std::vector<int> y(3);
|
||||
|
||||
fill(x.begin(), x.end(), 0);
|
||||
fill(y.begin(), y.end(), 1);
|
||||
std::fill(x.begin(), x.end(), 0);
|
||||
std::fill(y.begin(), y.end(), 1);
|
||||
|
||||
vector<pair<int, int> > v;
|
||||
std::vector<std::pair<int, int> > v;
|
||||
|
||||
transform(x.begin(), x.end(), y.begin(), back_inserter(v),
|
||||
bind(constructor<pair<int, int> >(), _1, _2) );
|
||||
std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
|
||||
bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
|
||||
}
|
||||
|
||||
int test_main(int, char *[]) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- control_structures.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// -- exception_test.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -29,7 +29,7 @@ using namespace boost::lambda;
|
||||
using namespace std;
|
||||
|
||||
// to prevent unused variables warnings
|
||||
template <class T> void dummy(const T& t) {}
|
||||
template <class T> void dummy(const T&) {}
|
||||
|
||||
void erroneous_exception_related_lambda_expressions() {
|
||||
|
||||
@@ -603,7 +603,7 @@ int test_main(int, char *[]) {
|
||||
return_type_matching();
|
||||
test_empty_catch_blocks();
|
||||
}
|
||||
catch (int x)
|
||||
catch (int)
|
||||
{
|
||||
BOOST_CHECK(false);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// extending_return_type_traits.cpp -- The Boost Lambda Library --------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "boost/lambda/bind.hpp"
|
||||
#include "boost/lambda/lambda.hpp"
|
||||
#include "boost/lambda/detail/suppress_unused.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -23,6 +24,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using boost::lambda::detail::suppress_unused_variable_warnings;
|
||||
|
||||
class A {};
|
||||
class B {};
|
||||
|
||||
@@ -81,7 +84,7 @@ struct plain_return_type_1<other_action<contentsof_action>, A> {
|
||||
} // lambda
|
||||
} // boost
|
||||
|
||||
void ok(B b) {}
|
||||
void ok(B /*b*/) {}
|
||||
|
||||
void test_unary_operators()
|
||||
{
|
||||
@@ -127,7 +130,7 @@ class my_vector {};
|
||||
|
||||
template<class A, class B>
|
||||
my_vector<typename return_type_2<arithmetic_action<plus_action>, A&, B&>::type>
|
||||
operator+(const my_vector<A>& a, const my_vector<B>& b)
|
||||
operator+(const my_vector<A>& /*a*/, const my_vector<B>& /*b*/)
|
||||
{
|
||||
typedef typename
|
||||
return_type_2<arithmetic_action<plus_action>, A&, B&>::type res_type;
|
||||
@@ -175,8 +178,8 @@ Z operator^=( X&, const Y&) { return Z(); }
|
||||
// assignment
|
||||
class Assign {
|
||||
public:
|
||||
void operator=(const Assign& a) {}
|
||||
X operator[](const int& i) { return X(); }
|
||||
void operator=(const Assign& /*a*/) {}
|
||||
X operator[](const int& /*i*/) { return X(); }
|
||||
};
|
||||
|
||||
|
||||
@@ -329,9 +332,16 @@ void test_binary_operators() {
|
||||
XX dummy3 = (_1 * _2)(vxx, vyy);
|
||||
VV dummy4 = (_1 * _2)(cvxx, cvyy);
|
||||
|
||||
suppress_unused_variable_warnings(dummy1);
|
||||
suppress_unused_variable_warnings(dummy2);
|
||||
suppress_unused_variable_warnings(dummy3);
|
||||
suppress_unused_variable_warnings(dummy4);
|
||||
|
||||
my_vector<int> v1; my_vector<double> v2;
|
||||
my_vector<double> d = (_1 + _2)(v1, v2);
|
||||
|
||||
suppress_unused_variable_warnings(d);
|
||||
|
||||
// bitwise
|
||||
|
||||
(_1 << _2)(x, y);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// is_instance_of_test.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
30
test/istreambuf_test.cpp
Normal file
30
test/istreambuf_test.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// istreambuf_test - test lambda function objects with istreambuf_iterator
|
||||
//
|
||||
// Copyright (c) 2007 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::lambda;
|
||||
|
||||
std::stringstream is( "ax2" );
|
||||
|
||||
std::istreambuf_iterator<char> b2( is );
|
||||
std::istreambuf_iterator<char> e2;
|
||||
|
||||
std::istreambuf_iterator<char> i = std::find_if( b2, e2, _1 == 'x' );
|
||||
|
||||
BOOST_TEST( *i == 'x' );
|
||||
BOOST_TEST( std::distance( i, e2 ) == 2 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// member_pointer_test.cpp -- The Boost Lambda Library ------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -118,11 +118,11 @@ class C {};
|
||||
class D {};
|
||||
|
||||
// ->* can be overloaded to do anything
|
||||
bool operator->*(A a, B b) {
|
||||
bool operator->*(A /*a*/, B /*b*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator->*(B b, A a) {
|
||||
bool operator->*(B /*b*/, A /*a*/) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// operator_tests_simple.cpp -- The Boost Lambda Library ---------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "boost/lambda/lambda.hpp"
|
||||
|
||||
#include "boost/lambda/detail/suppress_unused.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
@@ -96,6 +98,8 @@ void arithmetic_operators() {
|
||||
// test that unary plus really does something
|
||||
unary_plus_tester u;
|
||||
unary_plus_tester up = (+_1)(u);
|
||||
|
||||
boost::lambda::detail::suppress_unused_variable_warnings(up);
|
||||
}
|
||||
|
||||
void bitwise_operators() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// phoenix_style_control_structures.cpp -- The Boost Lambda Library ------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
57
test/rvalue_test.cpp
Normal file
57
test/rvalue_test.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
// rvalue_test - test lambda function objects with rvalue arguments
|
||||
//
|
||||
// Copyright (c) 2007 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::lambda;
|
||||
|
||||
int x = 0;
|
||||
int const y = 1;
|
||||
int const z = 2;
|
||||
|
||||
BOOST_TEST( _1( x ) == 0 );
|
||||
BOOST_TEST( _1( y ) == 1 );
|
||||
BOOST_TEST( _1( 2 ) == 2 );
|
||||
|
||||
BOOST_TEST( _2( x, x ) == 0 );
|
||||
BOOST_TEST( _2( x, y ) == 1 );
|
||||
BOOST_TEST( _2( x, 2 ) == 2 );
|
||||
|
||||
BOOST_TEST( _2( 4, x ) == 0 );
|
||||
BOOST_TEST( _2( 4, y ) == 1 );
|
||||
BOOST_TEST( _2( 4, 2 ) == 2 );
|
||||
|
||||
(_1 = _2)( x, y );
|
||||
BOOST_TEST( x == y );
|
||||
|
||||
(_1 = _2)( x, 3 );
|
||||
BOOST_TEST( x == 3 );
|
||||
|
||||
(_2 = _1)( z, x );
|
||||
BOOST_TEST( x == z );
|
||||
|
||||
(_2 = _1)( 4, x );
|
||||
BOOST_TEST( x == 4 );
|
||||
|
||||
BOOST_TEST( _3( x, x, x ) == x );
|
||||
BOOST_TEST( _3( x, x, y ) == y );
|
||||
BOOST_TEST( _3( x, x, 2 ) == 2 );
|
||||
|
||||
BOOST_TEST( _3( x, 5, x ) == x );
|
||||
BOOST_TEST( _3( x, 5, y ) == y );
|
||||
BOOST_TEST( _3( x, 5, 2 ) == 2 );
|
||||
|
||||
BOOST_TEST( _3( 9, 5, x ) == x );
|
||||
BOOST_TEST( _3( 9, 5, y ) == y );
|
||||
BOOST_TEST( _3( 9, 5, 2 ) == 2 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// switch_test.cpp -- The Boost Lambda Library --------------------------
|
||||
//
|
||||
// Copyright (C) 2000-2003 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
Reference in New Issue
Block a user