Compare commits

..

18 Commits

Author SHA1 Message Date
Nicola Musatti
cb1a2944fd bcbboost branch rebased on current release
[SVN r49389]
2008-10-19 14:43:01 +00:00
Douglas Gregor
587658b047 Merge Boost.Function fixes from trunk
[SVN r49361]
2008-10-16 13:21:50 +00:00
Nicola Musatti
29ef7ae490 Patches for Codegear C++ Builder 2009
[SVN r48981]
2008-09-27 08:59:20 +00:00
Douglas Gregor
83309a36c7 Merge Boost.Function from the trunk
[SVN r47422]
2008-07-14 18:32:29 +00:00
Douglas Gregor
bfdb5b161d Merged fixes for Function, Signals, and MPI from trunk. See #1499, see #1416, see #1486
[SVN r42031]
2007-12-14 14:48:14 +00:00
Beman Dawes
c4539395fe Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Nicola Musatti
d8c93cdc8d Merge from trunk
[SVN r39768]
2007-10-07 20:10:53 +00:00
Beman Dawes
6147e7ddcc Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
Nicola Musatti
5073f4fd97 Branch for CodeGear (Borland) specific fixes
[SVN r39356]
2007-09-17 20:28:43 +00:00
nobody
1b60e82b2f This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Thomas Witt
7581949360 Patches from Trac #583.
[SVN r37846]
2007-06-01 16:12:08 +00:00
Beman Dawes
0b2aeda226 Merged copyright and license addition
[SVN r35907]
2006-11-07 19:27:00 +00:00
Rene Rivera
2ecd62c612 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Douglas Gregor
47033bd162 Fix inspection problems
[SVN r35827]
2006-11-03 19:41:10 +00:00
Douglas Gregor
c7d5016022 Eliminate MSVC 8.0 warning
[SVN r35588]
2006-10-13 14:29:56 +00:00
Douglas Gregor
d92355cca2 Suppress annoying MSVC warnings
[SVN r35424]
2006-09-29 17:23:28 +00:00
Douglas Gregor
0123f84bff Suppress annoying MSVC warnings
[SVN r35423]
2006-09-29 17:23:17 +00:00
nobody
0207da8008 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
8 changed files with 20 additions and 112 deletions

View File

@@ -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
)

View File

@@ -1,2 +0,0 @@
boost_add_documentation(function.xml
faq.xml history.xml misc.xml reference.xml tests.xml tutorial.xml)

View File

@@ -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 ;

View File

@@ -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;
};

View File

@@ -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

View File

@@ -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

View File

@@ -1 +0,0 @@
boost_module(function DEPENDS detail preprocessor utility)

View File

@@ -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)