forked from boostorg/function
Merge branch 'develop'
This commit is contained in:
69
.travis.yml
Normal file
69
.travis.yml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
# Copyright 2016 Peter Dimov
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
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 init libs/algorithm
|
||||||
|
- git submodule init libs/align
|
||||||
|
- git submodule init libs/assert
|
||||||
|
- git submodule init libs/bind
|
||||||
|
- git submodule init libs/chrono
|
||||||
|
- git submodule init libs/config
|
||||||
|
- git submodule init libs/core
|
||||||
|
- git submodule init libs/detail
|
||||||
|
- git submodule init libs/exception
|
||||||
|
- git submodule init libs/integer
|
||||||
|
- git submodule init libs/io
|
||||||
|
- git submodule init libs/iterator
|
||||||
|
- git submodule init libs/lambda
|
||||||
|
- git submodule init libs/move
|
||||||
|
- git submodule init libs/mpl
|
||||||
|
- git submodule init libs/numeric/conversion
|
||||||
|
- git submodule init libs/predef
|
||||||
|
- git submodule init libs/preprocessor
|
||||||
|
- git submodule init libs/range
|
||||||
|
- git submodule init libs/ratio
|
||||||
|
- git submodule init libs/rational
|
||||||
|
- git submodule init libs/smart_ptr
|
||||||
|
- git submodule init libs/static_assert
|
||||||
|
- git submodule init libs/system
|
||||||
|
- git submodule init libs/optional
|
||||||
|
- git submodule init libs/test
|
||||||
|
- git submodule init libs/throw_exception
|
||||||
|
- git submodule init libs/timer
|
||||||
|
- git submodule init libs/tuple
|
||||||
|
- git submodule init libs/type_index
|
||||||
|
- git submodule init libs/type_traits
|
||||||
|
- git submodule init libs/typeof
|
||||||
|
- git submodule init libs/utility
|
||||||
|
- git submodule init libs/winapi
|
||||||
|
- git submodule init tools/build
|
||||||
|
- git submodule update --depth 1
|
||||||
|
- cp -r $TRAVIS_BUILD_DIR/* libs/function
|
||||||
|
- ./bootstrap.sh
|
||||||
|
- ./b2 headers
|
||||||
|
|
||||||
|
script:
|
||||||
|
- TOOLSET=gcc,clang
|
||||||
|
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
|
||||||
|
- ./b2 libs/function/test toolset=$TOOLSET
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
on_success: always
|
@ -656,17 +656,6 @@ namespace boost {
|
|||||||
BOOST_FUNCTION_TEMPLATE_PARMS
|
BOOST_FUNCTION_TEMPLATE_PARMS
|
||||||
>
|
>
|
||||||
class BOOST_FUNCTION_FUNCTION : public function_base
|
class BOOST_FUNCTION_FUNCTION : public function_base
|
||||||
|
|
||||||
#if BOOST_FUNCTION_NUM_ARGS == 1
|
|
||||||
|
|
||||||
, public std::unary_function<T0,R>
|
|
||||||
|
|
||||||
#elif BOOST_FUNCTION_NUM_ARGS == 2
|
|
||||||
|
|
||||||
, public std::binary_function<T0,T1,R>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifndef BOOST_NO_VOID_RETURNS
|
#ifndef BOOST_NO_VOID_RETURNS
|
||||||
|
@ -66,6 +66,8 @@ import testing ;
|
|||||||
[ run libs/function/test/rvalues_test.cpp : : : : ]
|
[ run libs/function/test/rvalues_test.cpp : : : : ]
|
||||||
|
|
||||||
[ compile libs/function/test/function_typeof_test.cpp ]
|
[ compile libs/function/test/function_typeof_test.cpp ]
|
||||||
|
|
||||||
|
[ run libs/function/test/result_arg_types_test.cpp ]
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
40
test/result_arg_types_test.cpp
Normal file
40
test/result_arg_types_test.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// Boost.Function library
|
||||||
|
|
||||||
|
// Copyright 2016 Peter Dimov
|
||||||
|
|
||||||
|
// Use, modification and distribution is subject to
|
||||||
|
// the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <boost/function.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
|
||||||
|
struct X
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Y
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Z
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
typedef boost::function<X(Y)> F1;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::result_type, X> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F1::argument_type, Y> ));
|
||||||
|
|
||||||
|
typedef boost::function<X(Y, Z)> F2;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::result_type, X> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::first_argument_type, Y> ));
|
||||||
|
BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<F2::second_argument_type, Z> ));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user