mirror of
https://github.com/boostorg/function.git
synced 2026-01-29 07:32:15 +00:00
Compare commits
18 Commits
sandbox-br
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1a2944fd | ||
|
|
587658b047 | ||
|
|
29ef7ae490 | ||
|
|
83309a36c7 | ||
|
|
bfdb5b161d | ||
|
|
c4539395fe | ||
|
|
d8c93cdc8d | ||
|
|
6147e7ddcc | ||
|
|
5073f4fd97 | ||
|
|
1b60e82b2f | ||
|
|
7581949360 | ||
|
|
0b2aeda226 | ||
|
|
2ecd62c612 | ||
|
|
47033bd162 | ||
|
|
c7d5016022 | ||
|
|
d92355cca2 | ||
|
|
0123f84bff | ||
|
|
0207da8008 |
@@ -1,22 +0,0 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
function.hpp
|
||||
function
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
function
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
DOCDIRS doc
|
||||
# DESCRIPTION
|
||||
MODULARIZED
|
||||
# AUTHORS
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
boost_add_documentation(function.xml
|
||||
faq.xml history.xml misc.xml reference.xml tests.xml tutorial.xml)
|
||||
@@ -6,10 +6,5 @@
|
||||
project boost/doc ;
|
||||
import boostbook : boostbook ;
|
||||
|
||||
boostbook function-doc
|
||||
:
|
||||
function.xml
|
||||
:
|
||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
|
||||
;
|
||||
boostbook function-doc : function.xml ;
|
||||
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
#include <typeinfo>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/integer.hpp>
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
@@ -45,7 +42,7 @@
|
||||
#endif
|
||||
|
||||
// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
|
||||
#ifdef BOOST_NO_STD_TYPEINFO
|
||||
#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE
|
||||
// Embedded VC++ does not have type_info in namespace std
|
||||
# define BOOST_FUNCTION_STD_NS
|
||||
#else
|
||||
@@ -628,7 +625,7 @@ public:
|
||||
if (!vtable) return typeid(void);
|
||||
|
||||
detail::function::function_buffer type;
|
||||
get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
|
||||
vtable->manager(functor, type, detail::function::get_functor_type_tag);
|
||||
return *type.type.type;
|
||||
}
|
||||
|
||||
@@ -641,7 +638,7 @@ public:
|
||||
type_result.type.type = &typeid(Functor);
|
||||
type_result.type.const_qualified = is_const<Functor>::value;
|
||||
type_result.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
get_vtable()->manager(functor, type_result,
|
||||
vtable->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
return static_cast<Functor*>(type_result.obj_ptr);
|
||||
}
|
||||
@@ -659,7 +656,7 @@ public:
|
||||
type_result.type.type = &typeid(Functor);
|
||||
type_result.type.const_qualified = true;
|
||||
type_result.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
get_vtable()->manager(functor, type_result,
|
||||
vtable->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
|
||||
// can't do the static_cast that we should do.
|
||||
@@ -705,15 +702,6 @@ public:
|
||||
#endif
|
||||
|
||||
public: // should be protected, but GCC 2.95.3 will fail to allow access
|
||||
detail::function::vtable_base* get_vtable() const {
|
||||
return reinterpret_cast<detail::function::vtable_base*>(
|
||||
reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
|
||||
}
|
||||
|
||||
bool has_trivial_copy_and_destroy() const {
|
||||
return reinterpret_cast<std::size_t>(vtable) & 0x01;
|
||||
}
|
||||
|
||||
detail::function::vtable_base* vtable;
|
||||
mutable detail::function::function_buffer functor;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace boost { namespace python { namespace objects {
|
||||
|
||||
#if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
|| defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
|
||||
|| !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
||||
|| !(BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
||||
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
|
||||
#endif
|
||||
|
||||
|
||||
@@ -678,11 +678,6 @@ namespace boost {
|
||||
R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
|
||||
vtable_type;
|
||||
|
||||
vtable_type* get_vtable() const {
|
||||
return reinterpret_cast<vtable_type*>(
|
||||
reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
|
||||
}
|
||||
|
||||
struct clear_type {};
|
||||
|
||||
public:
|
||||
@@ -762,7 +757,7 @@ namespace boost {
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
return get_vtable()->invoker
|
||||
return static_cast<vtable_type*>(vtable)->invoker
|
||||
(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#else
|
||||
@@ -852,8 +847,7 @@ namespace boost {
|
||||
void clear()
|
||||
{
|
||||
if (vtable) {
|
||||
if (!this->has_trivial_copy_and_destroy())
|
||||
get_vtable()->clear(this->functor);
|
||||
reinterpret_cast<vtable_type*>(vtable)->clear(this->functor);
|
||||
vtable = 0;
|
||||
}
|
||||
}
|
||||
@@ -882,11 +876,8 @@ namespace boost {
|
||||
{
|
||||
if (!f.empty()) {
|
||||
this->vtable = f.vtable;
|
||||
if (this->has_trivial_copy_and_destroy())
|
||||
this->functor = f.functor;
|
||||
else
|
||||
get_vtable()->base.manager(f.functor, this->functor,
|
||||
boost::detail::function::clone_functor_tag);
|
||||
f.vtable->manager(f.functor, this->functor,
|
||||
boost::detail::function::clone_functor_tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -912,15 +903,8 @@ namespace boost {
|
||||
static vtable_type stored_vtable =
|
||||
{ { &manager_type::manage }, &invoker_type::invoke };
|
||||
|
||||
if (stored_vtable.assign_to(f, functor)) {
|
||||
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
||||
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
||||
boost::has_trivial_destructor<Functor>::value &&
|
||||
detail::function::function_allows_small_object_optimization<Functor>::value)
|
||||
value |= (std::size_t)0x01;
|
||||
vtable = reinterpret_cast<detail::function::vtable_base *>(value);
|
||||
} else
|
||||
vtable = 0;
|
||||
if (stored_vtable.assign_to(f, functor)) vtable = &stored_vtable.base;
|
||||
else vtable = 0;
|
||||
}
|
||||
|
||||
template<typename Functor,typename Allocator>
|
||||
@@ -946,15 +930,8 @@ namespace boost {
|
||||
static vtable_type stored_vtable =
|
||||
{ { &manager_type::manage }, &invoker_type::invoke };
|
||||
|
||||
if (stored_vtable.assign_to_a(f, functor, a)) {
|
||||
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
||||
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
||||
boost::has_trivial_destructor<Functor>::value &&
|
||||
detail::function::function_allows_small_object_optimization<Functor>::value)
|
||||
value |= (std::size_t)0x01;
|
||||
vtable = reinterpret_cast<detail::function::vtable_base *>(value);
|
||||
} else
|
||||
vtable = 0;
|
||||
if (stored_vtable.assign_to_a(f, functor, a)) vtable = &stored_vtable.base;
|
||||
else vtable = 0;
|
||||
}
|
||||
|
||||
// Moves the value from the specified argument to *this. If the argument
|
||||
@@ -970,16 +947,13 @@ namespace boost {
|
||||
#endif
|
||||
if (!f.empty()) {
|
||||
this->vtable = f.vtable;
|
||||
if (this->has_trivial_copy_and_destroy())
|
||||
this->functor = f.functor;
|
||||
else
|
||||
get_vtable()->base.manager(f.functor, this->functor,
|
||||
boost::detail::function::move_functor_tag);
|
||||
f.vtable = 0;
|
||||
f.vtable->manager(f.functor, this->functor,
|
||||
boost::detail::function::move_functor_tag);
|
||||
f.vtable = 0;
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
} else {
|
||||
clear();
|
||||
}
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
} catch (...) {
|
||||
vtable = 0;
|
||||
throw;
|
||||
@@ -1005,14 +979,13 @@ namespace boost {
|
||||
template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS>
|
||||
typename BOOST_FUNCTION_FUNCTION<
|
||||
R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>::result_type
|
||||
inline
|
||||
BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
|
||||
BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
|
||||
::operator()(BOOST_FUNCTION_PARMS) const
|
||||
{
|
||||
if (this->empty())
|
||||
boost::throw_exception(bad_function_call());
|
||||
|
||||
return get_vtable()->invoker
|
||||
return reinterpret_cast<const vtable_type*>(vtable)->invoker
|
||||
(this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
boost_module(function DEPENDS detail preprocessor utility)
|
||||
@@ -1,23 +0,0 @@
|
||||
boost_additional_test_dependencies(function BOOST_DEPENDS test lambda)
|
||||
|
||||
|
||||
boost_test_run(lib_function_test function_test.cpp)
|
||||
boost_test_run(function_n_test)
|
||||
boost_test_run(allocator_test)
|
||||
boost_test_run(stateless_test)
|
||||
boost_test_run(lambda_test)
|
||||
boost_test_compile_fail(function_test_fail1)
|
||||
boost_test_compile_fail(function_test_fail2)
|
||||
boost_test_compile(function_30)
|
||||
boost_test_run(function_arith_cxx98)
|
||||
boost_test_run(function_arith_portable)
|
||||
boost_test_run(sum_avg_cxx98)
|
||||
boost_test_run(sum_avg_portable)
|
||||
boost_test_run(mem_fun_cxx98)
|
||||
boost_test_run(mem_fun_portable)
|
||||
boost_test_run(std_bind_cxx98)
|
||||
boost_test_run(std_bind_portable)
|
||||
boost_test_run(function_ref_cxx98)
|
||||
boost_test_run(function_ref_portable)
|
||||
boost_test_run(contains_test)
|
||||
boost_test_run(contains2_test)
|
||||
Reference in New Issue
Block a user