2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 04:42:28 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Beman Dawes
a51e081097 Branch for development of boost.system related changes
[SVN r40931]
2007-11-08 14:20:16 +00:00
60 changed files with 169 additions and 202 deletions

View File

@@ -12,5 +12,4 @@ boostbook tutorial
:
<xsl:param>boost.root=../../../../../..
<xsl:param>boost.libraries=../../../../../../libs/libraries.htm
<xsl:param>html.stylesheet=../../../../../../doc/html/boostbook.css
;

View File

@@ -31,7 +31,7 @@
<div><p class="copyright">Copyright © 2002-2005 Joel
de Guzman, David Abrahams</p></div>
<div><div class="legalnotice">
<a name="id455917"></a><p>
<a name="id387671"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
@@ -94,7 +94,7 @@
(IDL).
</p>
<a name="quickstart.hello_world"></a><h2>
<a name="id385257"></a>
<a name="id385737"></a>
Hello World
</h2>
<p>
@@ -146,7 +146,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: November 07, 2007 at 03:34:24 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
<td align="right"><div class="copyright-footer"><small></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav"><a accesskey="n" href="python/hello.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a></div>

View File

@@ -40,7 +40,7 @@
Python/C API at all. So stay tuned... <span class="inlinemediaobject"><img src="../images/smiley.png" alt="smiley"></span>
</p>
<a name="embedding.building_embedded_programs"></a><h2>
<a name="id471171"></a>
<a name="id471189"></a>
Building embedded programs
</h2>
<p>
@@ -82,7 +82,7 @@ exe embedded_program # name of the executable
&lt;find-library&gt;$(PYTHON_EMBEDDED_LIBRARY) ;
</pre>
<a name="embedding.getting_started"></a><h2>
<a name="id471276"></a>
<a name="id471294"></a>
Getting started
</h2>
<p>
@@ -139,7 +139,7 @@ exe embedded_program # name of the executable
automate the process.
</p>
<a name="using_the_interpreter.running_python_code"></a><h2>
<a name="id471439"></a>
<a name="id471457"></a>
Running Python code
</h2>
<p>
@@ -190,7 +190,7 @@ exe embedded_program # name of the executable
a phrase that is well-known in programming circles.
</p>
<a name="using_the_interpreter.manipulating_python_objects"></a><h2>
<a name="id472027"></a>
<a name="id472045"></a>
Manipulating Python objects
</h2>
<p>
@@ -217,7 +217,7 @@ exe embedded_program # name of the executable
<span class="keyword">int</span> <span class="identifier">five_squared</span> <span class="special">=</span> <span class="identifier">extract</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">result</span><span class="special">);</span>
</pre>
<a name="using_the_interpreter.exception_handling"></a><h2>
<a name="id472399"></a>
<a name="id472417"></a>
Exception handling
</h2>
<p>
@@ -268,13 +268,12 @@ exe embedded_program # name of the executable
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -49,13 +49,12 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -533,7 +533,7 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="python.class_operators_special_functions"></a>Class Operators/Special Functions</h3></div></div></div>
<a name="class_operators_special_functions.python_operators"></a><h2>
<a name="id461460"></a>
<a name="id461478"></a>
Python Operators
</h2>
<p>
@@ -582,7 +582,7 @@
expressions".
</p>
<a name="class_operators_special_functions.special_methods"></a><h2>
<a name="id462216"></a>
<a name="id462235"></a>
Special Methods
</h2>
<p>
@@ -624,13 +624,12 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -212,7 +212,7 @@ Namespaces are one honking great idea -- let's do more of those!
<li><span class="bold"><b>BOOM!</b></span></li>
</ol></div>
<a name="call_policies.call_policies"></a><h2>
<a name="id464076"></a>
<a name="id464095"></a>
Call Policies
</h2>
<p>
@@ -415,7 +415,7 @@ Namespaces are one honking great idea -- let's do more of those!
</li>
</ul></div>
<a name="default_arguments.boost_python_function_overloads"></a><h2>
<a name="id466117"></a>
<a name="id466136"></a>
BOOST_PYTHON_FUNCTION_OVERLOADS
</h2>
<p>
@@ -445,7 +445,7 @@ Namespaces are one honking great idea -- let's do more of those!
<span class="identifier">def</span><span class="special">(</span><span class="string">"foo"</span><span class="special">,</span> <span class="identifier">foo</span><span class="special">,</span> <span class="identifier">foo_overloads</span><span class="special">());</span>
</pre>
<a name="default_arguments.boost_python_member_function_overloads"></a><h2>
<a name="id466436"></a>
<a name="id466454"></a>
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS
</h2>
<p>
@@ -491,7 +491,7 @@ Namespaces are one honking great idea -- let's do more of those!
reference</a> for details.
</p>
<a name="default_arguments.init_and_optional"></a><h2>
<a name="id466799"></a>
<a name="id466818"></a>
init and optional
</h2>
<p>
@@ -565,7 +565,7 @@ Namespaces are one honking great idea -- let's do more of those!
(0) arguments and a maximum of 3 arguments.
</p>
<a name="auto_overloading.manual_wrapping"></a><h2>
<a name="id467581"></a>
<a name="id467599"></a>
Manual Wrapping
</h2>
<p>
@@ -605,13 +605,12 @@ Namespaces are one honking great idea -- let's do more of those!
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -26,7 +26,7 @@
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="python.hello"></a> Building Hello World</h2></div></div></div>
<a name="hello.from_start_to_finish"></a><h2>
<a name="id387672"></a>
<a name="id385425"></a>
From Start To Finish
</h2>
<p>
@@ -92,7 +92,7 @@
platforms. The complete list of Bjam executables can be found <a href="http://sourceforge.net/project/showfiles.php?group_id=7586" target="_top">here</a>.
</p>
<a name="hello.let_s_jam_"></a><h2>
<a name="id386265"></a>
<a name="id385582"></a>
Let's Jam!
</h2>
<p>
@@ -108,7 +108,7 @@
you going.
</p>
<a name="hello.running_bjam"></a><h2>
<a name="id386322"></a>
<a name="id386137"></a>
Running bjam
</h2>
<p>
@@ -192,13 +192,12 @@ bjam
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -190,13 +190,12 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -196,7 +196,7 @@
</span><span class="identifier">d</span><span class="special">[</span><span class="char">'whatever'</span><span class="special">]</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span> <span class="comment">// modifies the copy
</span></pre>
<a name="derived_object_types.class__lt_t_gt__as_objects"></a><h2>
<a name="id469586"></a>
<a name="id469604"></a>
class_&lt;T&gt; as objects
</h2>
<p>
@@ -341,13 +341,12 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -456,13 +456,12 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2005 Joel
<td align="right"><div class="copyright-footer"><small>Copyright © 2002-2005 Joel
de Guzman, David Abrahams<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
http://www.boost.org/LICENSE_1_0.txt </a>)
</p>
</div></td>
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@@ -32,7 +32,7 @@ struct implicit
arg_from_python<Source> get_source(obj);
bool convertible = get_source.convertible();
BOOST_VERIFY(convertible);
BOOST_ASSERT(convertible);
new (storage) Target(get_source());

View File

@@ -117,9 +117,9 @@ struct rvalue_from_python_data : rvalue_from_python_storage<T>
// Implementataions
//
template <class T>
inline rvalue_from_python_data<T>::rvalue_from_python_data(rvalue_from_python_stage1_data const& _stage1)
inline rvalue_from_python_data<T>::rvalue_from_python_data(rvalue_from_python_stage1_data const& stage1)
{
this->stage1 = _stage1;
this->stage1 = stage1;
}
template <class T>

View File

@@ -265,8 +265,7 @@ inline object make_getter(D const& d, Policies const& policies)
template <class D>
inline object make_getter(D& x)
{
detail::not_specified policy
= detail::not_specified(); // suppress a SunPro warning
detail::not_specified policy;
return detail::make_getter(x, policy, is_member_pointer<D>(), 0L);
}
@@ -274,8 +273,7 @@ inline object make_getter(D& x)
template <class D>
inline object make_getter(D const& d)
{
detail::not_specified policy
= detail::not_specified(); // Suppress a SunPro warning
detail::not_specified policy;
return detail::make_getter(d, policy, is_member_pointer<D>(), 0L);
}
# endif

View File

@@ -95,7 +95,7 @@ result(X const&, short = 0) { return 0; }
# define N BOOST_PP_ITERATION()
template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
boost::type<R>* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0)
boost::type<R>* result(R (*pf)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0)
{
return 0;
}
@@ -120,7 +120,7 @@ boost::type<R>* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0)
# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1))
template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
boost::type<R>* result(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0)
boost::type<R>* result(R (T::*pmf)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0)
{
return 0;
}

View File

@@ -149,7 +149,7 @@ struct unwind_helper2<reference_to_pointer_>
template <class Generator, class U>
inline typename Generator::result_type
#ifndef _MSC_VER
unwind_type(boost::type<U>*, Generator*)
unwind_type(boost::type<U>*p, Generator*)
#else
unwind_type(boost::type<U>*p =0, Generator* =0)
#endif

View File

@@ -236,7 +236,7 @@ struct class_metadata
//
// Support for converting smart pointers to python
//
inline static void maybe_register_pointer_to_python(...) {}
inline static void maybe_register_pointer_to_python(void*,void*,void*) {}
#ifndef BOOST_PYTHON_NO_PY_SYGNATURES
inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*)

View File

@@ -127,14 +127,7 @@ void* pointer_holder<Pointer, Value>::holds(type_info dst_t, bool null_ptr_only)
)
return &this->m_p;
Value* p
# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
= static_cast<Value*>( get_pointer(this->m_p) )
# else
= get_pointer(this->m_p)
# endif
;
Value* p = get_pointer(this->m_p);
if (p == 0)
return 0;

View File

@@ -10,59 +10,48 @@
# include <boost/python/object_protocol_core.hpp>
# include <boost/python/object_core.hpp>
# include <boost/detail/workaround.hpp>
namespace boost { namespace python { namespace api {
# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
// attempt to use SFINAE to prevent functions accepting T const& from
// coming up as ambiguous with the one taking a char const* when a
// string literal is passed
# define BOOST_PYTHON_NO_ARRAY_ARG(T) , T (*)() = 0
# else
# define BOOST_PYTHON_NO_ARRAY_ARG(T)
# endif
template <class Target, class Key>
object getattr(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
object getattr(Target const& target, Key const& key)
{
return getattr(object(target), object(key));
}
template <class Target, class Key, class Default>
object getattr(Target const& target, Key const& key, Default const& default_ BOOST_PYTHON_NO_ARRAY_ARG(Key))
object getattr(Target const& target, Key const& key, Default const& default_)
{
return getattr(object(target), object(key), object(default_));
}
template <class Key, class Value>
void setattr(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key))
void setattr(object const& target, Key const& key, Value const& value)
{
setattr(target, object(key), object(value));
}
template <class Key>
void delattr(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
void delattr(object const& target, Key const& key)
{
delattr(target, object(key));
}
template <class Target, class Key>
object getitem(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
object getitem(Target const& target, Key const& key)
{
return getitem(object(target), object(key));
}
template <class Key, class Value>
void setitem(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key))
void setitem(object const& target, Key const& key, Value const& value)
{
setitem(target, object(key), object(value));
}
template <class Key>
void delitem(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
void delitem(object const& target, Key const& key)
{
delitem(target, object(key));
}

View File

@@ -27,12 +27,6 @@ struct slice_policies : const_slice_policies
static void del(object const& target, key_type const& key);
};
template <class T, class U>
inline slice_policies::key_type slice_key(T x, U y)
{
return slice_policies::key_type(handle<>(x), handle<>(y));
}
//
// implementation
//
@@ -41,7 +35,7 @@ object_slice
object_operators<U>::slice(object_cref start, object_cref finish)
{
object_cref2 x = *static_cast<U*>(this);
return object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
return object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr())));
}
template <class U>
@@ -49,7 +43,7 @@ const_object_slice
object_operators<U>::slice(object_cref start, object_cref finish) const
{
object_cref2 x = *static_cast<U const*>(this);
return const_object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
return const_object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr())));
}
template <class U>
@@ -57,7 +51,7 @@ object_slice
object_operators<U>::slice(slice_nil, object_cref finish)
{
object_cref2 x = *static_cast<U*>(this);
return object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
return object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
}
template <class U>
@@ -65,7 +59,7 @@ const_object_slice
object_operators<U>::slice(slice_nil, object_cref finish) const
{
object_cref2 x = *static_cast<U const*>(this);
return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
}
template <class U>
@@ -73,7 +67,7 @@ object_slice
object_operators<U>::slice(slice_nil, slice_nil)
{
object_cref2 x = *static_cast<U*>(this);
return object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
}
template <class U>
@@ -81,7 +75,7 @@ const_object_slice
object_operators<U>::slice(slice_nil, slice_nil) const
{
object_cref2 x = *static_cast<U const*>(this);
return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
}
template <class U>
@@ -89,7 +83,7 @@ object_slice
object_operators<U>::slice(object_cref start, slice_nil)
{
object_cref2 x = *static_cast<U*>(this);
return object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
return object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0)));
}
template <class U>
@@ -97,7 +91,7 @@ const_object_slice
object_operators<U>::slice(object_cref start, slice_nil) const
{
object_cref2 x = *static_cast<U const*>(this);
return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
return const_object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0)));
}
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
template <class U>

View File

@@ -36,7 +36,7 @@ template <bool is_const_ref>
struct object_manager_get_pytype
{
template <class U>
static PyTypeObject const* get( U& (*)() =0)
static PyTypeObject const* get( U& (*p)() =0)
{
return converter::object_manager_traits<U>::get_pytype();
}
@@ -46,7 +46,7 @@ template <>
struct object_manager_get_pytype<true>
{
template <class U>
static PyTypeObject const* get( U const& (*)() =0)
static PyTypeObject const* get( U const& (*p)() =0)
{
return converter::object_manager_traits<U>::get_pytype();
}

2
pyste/dist/.cvsignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.zip
*.pyc

View File

@@ -0,0 +1,2 @@
*.pyc
.project

10
pyste/tests/.cvsignore Normal file
View File

@@ -0,0 +1,10 @@
*.pyc
*.exp
*.lib
*.obj
*.arg
*.dll
.sconsign
cache
*.cpp
*.pch

View File

@@ -29,7 +29,7 @@ namespace
detail::new_reference dict_base::call(object const& arg_)
{
return (detail::new_reference)PyObject_CallFunction(
(PyObject*)&PyDict_Type, const_cast<char*>("(O)"),
(PyObject*)&PyDict_Type, "(O)",
arg_.ptr());
}

View File

@@ -39,7 +39,7 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local)
// should be 'char const *' but older python versions don't use 'const' yet.
char *f = python::extract<char *>(filename);
// Let python open the file to avoid potential binary incompatibilities.
PyObject *pyfile = PyFile_FromString(f, const_cast<char*>("r"));
PyObject *pyfile = PyFile_FromString(f, "r");
if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file");
python::handle<> file(pyfile);
PyObject* result = PyRun_File(PyFile_AsFile(file.get()),

View File

@@ -13,7 +13,7 @@ detail::new_non_null_reference list_base::call(object const& arg_)
return (detail::new_non_null_reference)
(expect_non_null)(
PyObject_CallFunction(
(PyObject*)&PyList_Type, const_cast<char*>("(O)"),
(PyObject*)&PyList_Type, "(O)",
arg_.ptr()));
}

View File

@@ -9,21 +9,21 @@ namespace boost { namespace python { namespace detail {
new_non_null_reference long_base::call(object const& arg_)
{
return (detail::new_non_null_reference)PyObject_CallFunction(
(PyObject*)&PyLong_Type, const_cast<char*>("(O)"),
(PyObject*)&PyLong_Type, "(O)",
arg_.ptr());
}
new_non_null_reference long_base::call(object const& arg_, object const& base)
{
return (detail::new_non_null_reference)PyObject_CallFunction(
(PyObject*)&PyLong_Type, const_cast<char*>("(OO)"),
(PyObject*)&PyLong_Type, "(OO)",
arg_.ptr(), base.ptr());
}
long_base::long_base()
: object(
detail::new_reference(
PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast<char*>("()")))
PyObject_CallFunction((PyObject*)&PyLong_Type, "()"))
)
{}

View File

@@ -118,7 +118,7 @@ namespace aux
{
load(false);
if(!array_type) return 0;
return downcast<PyTypeObject>(array_type.get());
return handle<PyTypeObject>(array_type).get();
}
# define BOOST_PYTHON_AS_OBJECT(z, n, _) object(x##n)

View File

@@ -74,7 +74,7 @@ extern "C"
{
propertyobject *gs = (propertyobject *)self;
return PyObject_CallFunction(gs->prop_get, const_cast<char*>("()"));
return PyObject_CallFunction(gs->prop_get, "()");
}
static int
@@ -95,9 +95,9 @@ extern "C"
return -1;
}
if (value == NULL)
res = PyObject_CallFunction(func, const_cast<char*>("()"));
res = PyObject_CallFunction(func, "()");
else
res = PyObject_CallFunction(func, const_cast<char*>("(O)"), value);
res = PyObject_CallFunction(func, "(O)", value);
if (res == NULL)
return -1;
Py_DECREF(res);
@@ -108,7 +108,7 @@ extern "C"
static PyTypeObject static_data_object = {
PyObject_HEAD_INIT(0)//&PyType_Type)
0,
const_cast<char*>("Boost.Python.StaticProperty"),
"Boost.Python.StaticProperty",
PyType_Type.tp_basicsize,
0,
0, /* tp_dealloc */
@@ -212,7 +212,7 @@ extern "C"
static PyTypeObject class_metatype_object = {
PyObject_HEAD_INIT(0)//&PyType_Type)
0,
const_cast<char*>("Boost.Python.class"),
"Boost.Python.class",
PyType_Type.tp_basicsize,
0,
0, /* tp_dealloc */
@@ -316,7 +316,7 @@ namespace objects
{
// Attempt to find the __instance_size__ attribute. If not present, no problem.
PyObject* d = type_->tp_dict;
PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast<char*>("__instance_size__"));
PyObject* instance_size_obj = PyObject_GetAttrString(d, "__instance_size__");
long instance_size = instance_size_obj ? PyInt_AsLong(instance_size_obj) : 0;
@@ -357,20 +357,20 @@ namespace objects
static PyGetSetDef instance_getsets[] = {
{const_cast<char*>("__dict__"), instance_get_dict, instance_set_dict, NULL, 0},
{"__dict__", instance_get_dict, instance_set_dict, NULL, 0},
{0, 0, 0, 0, 0}
};
static PyMemberDef instance_members[] = {
{const_cast<char*>("__weakref__"), T_OBJECT, offsetof(instance<>, weakrefs), 0, 0},
{"__weakref__", T_OBJECT, offsetof(instance<>, weakrefs), 0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject class_type_object = {
PyObject_HEAD_INIT(0) //&class_metatype_object)
0,
const_cast<char*>("Boost.Python.instance"),
"Boost.Python.instance",
offsetof(instance<>,storage), /* tp_basicsize */
1, /* tp_itemsize */
instance_dealloc, /* tp_dealloc */
@@ -572,7 +572,7 @@ namespace objects
{
object property(
(python::detail::new_reference)
PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("Osss"), fget.ptr(), 0, 0, docstr));
PyObject_CallFunction((PyObject*)&PyProperty_Type, "Osss", fget.ptr(), 0, 0, docstr));
this->setattr(name, property);
}
@@ -582,7 +582,7 @@ namespace objects
{
object property(
(python::detail::new_reference)
PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), 0, docstr));
PyObject_CallFunction((PyObject*)&PyProperty_Type, "OOss", fget.ptr(), fset.ptr(), 0, docstr));
this->setattr(name, property);
}
@@ -591,7 +591,7 @@ namespace objects
{
object property(
(python::detail::new_reference)
PyObject_CallFunction(static_data(), const_cast<char*>("O"), fget.ptr()));
PyObject_CallFunction(static_data(), "O", fget.ptr()));
this->setattr(name, property);
}
@@ -600,7 +600,7 @@ namespace objects
{
object property(
(python::detail::new_reference)
PyObject_CallFunction(static_data(), const_cast<char*>("OO"), fget.ptr(), fset.ptr()));
PyObject_CallFunction(static_data(), "OO", fget.ptr(), fset.ptr()));
this->setattr(name, property);
}
@@ -615,13 +615,13 @@ namespace objects
{
extern "C" PyObject* no_init(PyObject*, PyObject*)
{
::PyErr_SetString(::PyExc_RuntimeError, const_cast<char*>("This class cannot be instantiated from Python"));
::PyErr_SetString(::PyExc_RuntimeError, "This class cannot be instantiated from Python");
return NULL;
}
static ::PyMethodDef no_init_def = {
const_cast<char*>("__init__"), no_init, METH_VARARGS,
const_cast<char*>("Raises an exception\n"
"This class cannot be instantiated from Python\n")
"__init__", no_init, METH_VARARGS,
"Raises an exception\n"
"This class cannot be instantiated from Python\n"
};
}
@@ -650,7 +650,7 @@ namespace objects
::PyErr_Format(
PyExc_TypeError
, const_cast<char*>("staticmethod expects callable object; got an object of type %s, which is not callable")
, "staticmethod expects callable object; got an object of type %s, which is not callable"
, callable->ob_type->tp_name
);

View File

@@ -23,7 +23,7 @@ struct enum_object
};
static PyMemberDef enum_members[] = {
{const_cast<char*>("name"), T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0},
{"name", T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0},
{0, 0, 0, 0, 0}
};
@@ -32,7 +32,7 @@ extern "C"
{
static PyObject* enum_repr(PyObject* self_)
{
const char *mod = PyString_AsString(PyObject_GetAttrString( self_, const_cast<char*>("__module__")));
const char *mod = PyString_AsString(PyObject_GetAttrString( self_, "__module__"));
enum_object* self = downcast<enum_object>(self_);
if (!self->name)
{
@@ -65,7 +65,7 @@ extern "C"
static PyTypeObject enum_type_object = {
PyObject_HEAD_INIT(0) // &PyType_Type
0,
const_cast<char*>("Boost.Python.enum"),
"Boost.Python.enum",
sizeof(enum_object), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */

View File

@@ -297,7 +297,7 @@ object function::signatures(bool show_return_type) const
void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
{
static handle<> exception(
PyErr_NewException(const_cast<char*>("Boost.Python.ArgumentError"), PyExc_TypeError, 0));
PyErr_NewException("Boost.Python.ArgumentError", PyExc_TypeError, 0));
object message = "Python argument types in\n %s.%s("
% make_tuple(this->m_namespace, this->m_name);
@@ -440,7 +440,7 @@ void function::add_to_namespace(
else if (PyType_Check(ns))
dict = ((PyTypeObject*)ns)->tp_dict;
else
dict = PyObject_GetAttrString(ns, const_cast<char*>("__dict__"));
dict = PyObject_GetAttrString(ns, "__dict__");
if (dict == 0)
throw_error_already_set();
@@ -487,7 +487,7 @@ void function::add_to_namespace(
new_func->m_name = name;
handle<> name_space_name(
allow_null(::PyObject_GetAttrString(name_space.ptr(), const_cast<char*>("__name__"))));
allow_null(::PyObject_GetAttrString(name_space.ptr(), "__name__")));
if (name_space_name)
new_func->m_namespace = object(name_space_name);
@@ -656,18 +656,18 @@ extern "C"
}
static PyGetSetDef function_getsetlist[] = {
{const_cast<char*>("__name__"), (getter)function_get_name, 0, 0, 0 },
{const_cast<char*>("func_name"), (getter)function_get_name, 0, 0, 0 },
{const_cast<char*>("__class__"), (getter)function_get_class, 0, 0, 0 }, // see note above
{const_cast<char*>("__doc__"), (getter)function_get_doc, (setter)function_set_doc, 0, 0},
{const_cast<char*>("func_doc"), (getter)function_get_doc, (setter)function_set_doc, 0, 0},
{"__name__", (getter)function_get_name, 0, 0, 0 },
{"func_name", (getter)function_get_name, 0, 0, 0 },
{"__class__", (getter)function_get_class, 0, 0, 0 }, // see note above
{"__doc__", (getter)function_get_doc, (setter)function_set_doc, 0, 0},
{"func_doc", (getter)function_get_doc, (setter)function_set_doc, 0, 0},
{NULL, 0, 0, 0, 0} /* Sentinel */
};
PyTypeObject function_type = {
PyObject_HEAD_INIT(0)
0,
const_cast<char*>("Boost.Python.function"),
"Boost.Python.function",
sizeof(function),
0,
(destructor)function_dealloc, /* tp_dealloc */
@@ -753,8 +753,7 @@ namespace detail
}
void BOOST_PYTHON_DECL pure_virtual_called()
{
PyErr_SetString(
PyExc_RuntimeError, const_cast<char*>("Pure virtual function called"));
PyErr_SetString(PyExc_RuntimeError, "Pure virtual function called");
throw_error_already_set();
}
}

View File

@@ -38,7 +38,7 @@ extern "C"
PyTypeObject life_support_type = {
PyObject_HEAD_INIT(0)//(&PyType_Type)
0,
const_cast<char*>("Boost.Python.life_support"),
"Boost.Python.life_support",
sizeof(life_support),
0,
life_support_dealloc, /* tp_dealloc */

View File

@@ -10,7 +10,7 @@ namespace boost { namespace python { namespace detail {
detail::new_reference str_base::call(object const& arg_)
{
return (detail::new_reference)PyObject_CallFunction(
(PyObject*)&PyString_Type, const_cast<char*>("(O)"),
(PyObject*)&PyString_Type, "(O)",
arg_.ptr());
}
@@ -68,9 +68,8 @@ str str_base:: name ( BOOST_PP_ENUM_PARAMS(arity, object_cref x) ) const
return str(new_reference( \
expect_non_null( \
PyObject_CallMethod( \
this->ptr(), const_cast<char*>( #name ), \
const_cast<char*>( \
"(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")") \
this->ptr(), #name, \
"(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")" \
BOOST_PP_REPEAT_1(arity, BOOST_PYTHON_OBJECT_PTR, _))))); \
}

View File

@@ -9,7 +9,7 @@ namespace boost { namespace python { namespace detail {
detail::new_reference tuple_base::call(object const& arg_)
{
return (detail::new_reference)PyObject_CallFunction(
(PyObject*)&PyTuple_Type, const_cast<char*>("(O)"),
(PyObject*)&PyTuple_Type, "(O)",
arg_.ptr());
}

View File

@@ -5,10 +5,7 @@
import python ;
use-project /boost/python : ../build ;
project /boost/python/test
: requirements
<toolset>gcc:<cxxflags>-Wextra
;
project /boost/python/test ;
local PY = ;
if [ python.configured ]
@@ -42,7 +39,7 @@ test-suite python
:
[
run exec.cpp /boost/python//boost_python/<link>static $(PY)
run exec.cpp ../build//boost_python/<link>static $(PY)
: # program args
: exec.py # input files
: # requirements
@@ -171,8 +168,7 @@ bpl-test crossmod_opaque
/boost/python//boost_python ]
[ bpl-test
map_indexing_suite : map_indexing_suite.py map_indexing_suite_ext ]
[ run import_.cpp /boost/python//boost_python $(PY) : : import_.py ]
[ py-run import_.cpp : import_.py ]
# if $(TEST_BIENSTMAN_NON_BUGS)
# {

View File

@@ -25,8 +25,8 @@ class B {
B() {
a = A::A_ptr(new A());
}
void set(A::A_ptr _a) {
this->a = _a;
void set(A::A_ptr a) {
this->a = a;
}
A::A_ptr get() {
return a;

View File

@@ -27,7 +27,7 @@ struct X
X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
int value() const { BOOST_ASSERT(magic == 7654321); return x; }
static int count() { return counter; }
private:

View File

@@ -11,7 +11,7 @@ struct A {};
struct V
{
virtual ~V() {}; // silence compiler warningsa
virtual void f() = 0;
const A* inside() {return &a;}

View File

@@ -7,7 +7,6 @@
struct V
{
virtual ~V() {}; // silence compiler warningsa
virtual void f() = 0;
};

View File

@@ -9,13 +9,13 @@
using namespace boost::python;
template <class T>
void assert_borrowed_ptr(T const&)
void assert_borrowed_ptr(T const& x)
{
BOOST_STATIC_ASSERT(boost::python::detail::is_borrowed_ptr<T>::value);
}
template <class T>
void assert_not_borrowed_ptr(T const&)
void assert_not_borrowed_ptr(T const& x)
{
BOOST_STATIC_ASSERT(!boost::python::detail::is_borrowed_ptr<T>::value);
}

View File

@@ -34,7 +34,7 @@ struct X
X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
int value() const { BOOST_ASSERT(magic == 7654321); return x; }
static int count() { return counter; }
private:

View File

@@ -19,10 +19,10 @@ struct complicated
int n;
};
inline complicated::complicated(simple const&s, int _n)
: s(s.s), n(_n)
inline complicated::complicated(simple const&s, int n)
: s(s.s), n(n)
{
std::cout << "constructing complicated: " << this->s << ", " << _n << std::endl;
std::cout << "constructing complicated: " << this->s << ", " << n << std::endl;
}
inline complicated::~complicated()

View File

@@ -16,7 +16,10 @@
#endif
using namespace boost::python;
namespace bpl = boost::python;
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
# define make_tuple boost::python::make_tuple
#endif
char const* const format = "int(%s); char(%s); string(%s); double(%s); ";
@@ -28,25 +31,25 @@ char const* const format = "int(%s); char(%s); string(%s); double(%s); ";
object
bar(int a, char b, std::string c, double d)
{
return format % bpl::make_tuple(a, b, c, d);
return format % make_tuple(a, b, c, d);
}
object
bar(int a, char b, std::string c)
{
return format % bpl::make_tuple(a, b, c, 0.0);
return format % make_tuple(a, b, c, 0.0);
}
object
bar(int a, char b)
{
return format % bpl::make_tuple(a, b, "default", 0.0);
return format % make_tuple(a, b, "default", 0.0);
}
object
bar(int a)
{
return format % bpl::make_tuple(a, 'D', "default", 0.0);
return format % make_tuple(a, 'D', "default", 0.0);
}
BOOST_PYTHON_FUNCTION_OVERLOADS(bar_stubs, bar, 1, 4)
@@ -59,7 +62,7 @@ BOOST_PYTHON_FUNCTION_OVERLOADS(bar_stubs, bar, 1, 4)
object
foo(int a, char b = 'D', std::string c = "default", double d = 0.0)
{
return format % bpl::make_tuple(a, b, c, d);
return format % make_tuple(a, b, c, d);
}
BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4)
@@ -76,7 +79,7 @@ struct Y {
object
get_state() const
{
return format % bpl::make_tuple(a, b, c, d);
return format % make_tuple(a, b, c, d);
}
int a; char b; std::string c; double d;
@@ -88,17 +91,17 @@ struct X {
X() {}
X(int a, char b = 'D', std::string c = "constructor", double d = 0.0)
: state(format % bpl::make_tuple(a, b, c, d))
: state(format % make_tuple(a, b, c, d))
{}
X(std::string s, bool b)
: state("Got exactly two arguments from constructor: string(%s); bool(%s); " % bpl::make_tuple(s, b*1))
: state("Got exactly two arguments from constructor: string(%s); bool(%s); " % make_tuple(s, b*1))
{}
object
bar(int a, char b = 'D', std::string c = "default", double d = 0.0) const
{
return format % bpl::make_tuple(a, b, c, d);
return format % make_tuple(a, b, c, d);
}
Y const&
@@ -115,19 +118,19 @@ struct X {
object
foo(int a, bool b=false) const
{
return "int(%s); bool(%s); " % bpl::make_tuple(a, b*1);
return "int(%s); bool(%s); " % make_tuple(a, b*1);
}
object
foo(std::string a, bool b=false) const
{
return "string(%s); bool(%s); " % bpl::make_tuple(a, b*1);
return "string(%s); bool(%s); " % make_tuple(a, b*1);
}
object
foo(list a, list b, bool c=false) const
{
return "list(%s); list(%s); bool(%s); " % bpl::make_tuple(a, b, c*1);
return "list(%s); list(%s); bool(%s); " % make_tuple(a, b, c*1);
}
object

View File

@@ -59,7 +59,7 @@ void eval_test()
void exec_test()
{
// Register the module with the interpreter
if (PyImport_AppendInittab(const_cast<char*>("embedded_hello"), initembedded_hello) == -1)
if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1)
throw std::runtime_error("Failed to add embedded_hello to the interpreter's "
"builtin modules");
// Retrieve the main module

View File

@@ -24,7 +24,6 @@ X make_x(int n) { return X(n); }
struct bar {};
struct foo
{
virtual ~foo() {}; // silence compiler warnings
virtual void f() = 0;
operator bar() const { return bar(); }
};

View File

@@ -34,7 +34,7 @@ struct NoddyObject : PyObject
PyTypeObject NoddyType = {
PyObject_HEAD_INIT(NULL)
0,
const_cast<char*>("Noddy"),
"Noddy",
sizeof(NoddyObject),
0,
dealloc, /* tp_dealloc */
@@ -106,7 +106,7 @@ struct extract_simple_object
PyTypeObject SimpleType = {
PyObject_HEAD_INIT(NULL)
0,
const_cast<char*>("Simple"),
"Simple",
sizeof(SimpleObject),
0,
dealloc, /* tp_dealloc */
@@ -159,7 +159,7 @@ PyTypeObject SimpleType = {
PyObject* new_simple()
{
SimpleObject* simple = PyObject_New(SimpleObject, &SimpleType);
simple->x.s = const_cast<char*>("hello, world");
simple->x.s = "hello, world";
return (PyObject*)simple;
}

View File

@@ -12,7 +12,7 @@
using namespace boost::python;
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
# define make_tuple ::boost::python::make_tuple
# define make_tuple boost::python::make_tuple
#endif
// See if we can invoke array() from C++
@@ -51,7 +51,7 @@ namespace
str format("exception type: %sn");
format += "exception value: %sn";
format += "traceback:n%s" ;
object ret = format % make_tuple(ty, v, tr);
object ret = format % boost::python::make_tuple(ty, v, tr);
return ret;
}
}

View File

@@ -5,10 +5,10 @@ struct vector
{
virtual ~vector() {}
vector operator+( const vector& ) const
vector operator+( const vector& x ) const
{ return vector(); }
vector& operator+=( const vector& )
vector& operator+=( const vector& x )
{ return *this; }
vector operator-() const

View File

@@ -27,8 +27,8 @@ namespace boost_python_test {
private:
std::string country;
public:
world(const std::string& _country) {
this->country = _country;
world(const std::string& country) {
this->country = country;
}
std::string greet() const { return "Hello from " + country + "!"; }
std::string get_country() const { return country; }

View File

@@ -34,8 +34,8 @@ namespace boost_python_test {
class world
{
public:
world(const std::string& _country) : secret_number(0) {
this->country = _country;
world(const std::string& country) : secret_number(0) {
this->country = country;
}
std::string greet() const { return "Hello from " + country + "!"; }
std::string get_country() const { return country; }

View File

@@ -35,8 +35,8 @@ namespace boost_python_test {
class world
{
public:
world(const std::string& _country) : secret_number(0) {
this->country = _country;
world(const std::string& country) : secret_number(0) {
this->country = country;
}
std::string greet() const { return "Hello from " + country + "!"; }
std::string get_country() const { return country; }

View File

@@ -23,8 +23,8 @@ namespace boost_python_test {
private:
std::string country;
public:
world(const std::string& _country) {
this->country = _country;
world(const std::string& country) {
this->country = country;
}
std::string greet() const { return "Hello from " + country + "!"; }
std::string get_country() const { return country; }

View File

@@ -10,7 +10,6 @@ using namespace boost::python;
class Abstract
{
public:
virtual ~Abstract() {}; // silence compiler warningsa
virtual std::string f() =0;
};

View File

@@ -129,7 +129,6 @@ shared_ptr<Y> factory(int n)
// regressions from Nicodemus
struct A
{
virtual ~A() {}; // silence compiler warnings
virtual int f() = 0;
static int call_f(shared_ptr<A>& a) { return a->f(); }
};

View File

@@ -100,11 +100,7 @@ bool accept_slice( slice) { return true; }
|| BOOST_WORKAROUND( BOOST_INTEL_WIN, == 710)
int check_slice_get_indicies(slice index);
#endif
int check_slice_get_indicies(
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
const
#endif
slice index)
int check_slice_get_indicies(const slice index)
{
// A vector of integers from [-5, 5].
std::vector<int> coll(11);

View File

@@ -20,7 +20,7 @@ struct X
X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
int value() const { BOOST_ASSERT(magic == 7654321); return x; }
static int count() { return counter; }
private:

View File

@@ -13,7 +13,7 @@ struct test_class
test_class(test_class const& rhs) : x(rhs.x), magic(7654321 + n) { ++counter; }
virtual ~test_class() { BOOST_TEST(magic == 7654321 + n); magic = 6666666; x = 9999; --counter; }
void set(int _x) { BOOST_TEST(magic == 7654321 + n); this->x = _x; }
void set(int x) { BOOST_TEST(magic == 7654321 + n); this->x = x; }
int value() const { BOOST_TEST(magic == 7654321 + n); return x; }
operator int() const { return x; }
static int count() { return counter; }

View File

@@ -65,7 +65,7 @@ struct B
B() : x(0) {}
B(A* x_) : x(x_) {}
inner const* adopt(A* _x) { this->x = _x; return &_x->get_inner(); }
inner const* adopt(A* x) { this->x = x; return &x->get_inner(); }
std::string a_content()
{

View File

@@ -22,7 +22,7 @@ struct X
X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
int value() const { BOOST_ASSERT(magic == 7654321); return x; }
static int count() { return counter; }
private:

View File

@@ -13,7 +13,6 @@
struct data
{
virtual ~data() {}; // silence compiler warnings
virtual int id() const
{
return 42;