mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 06:42:27 +00:00
more implicit conversion work
[SVN r13282]
This commit is contained in:
@@ -37,7 +37,7 @@ struct implicit
|
||||
registration->construct(obj, &intermediate_data.stage1);
|
||||
|
||||
void* storage = ((rvalue_base_data<Target>*)data)->storage.bytes;
|
||||
new (storage) Target(*(Source*)intermediate_data.storage.bytes);
|
||||
new (storage) Target(*static_cast<Source*>(intermediate_data.stage1.convertible));
|
||||
|
||||
// record successful construction
|
||||
data->convertible = storage;
|
||||
|
||||
@@ -37,6 +37,14 @@ namespace registry
|
||||
, undecorated_type_id_t
|
||||
);
|
||||
|
||||
// Insert an rvalue from_python converter at the tail of the
|
||||
// chain. Used for implicit conversions
|
||||
BOOST_PYTHON_DECL void push_back(
|
||||
void* (*convertible)(PyObject*)
|
||||
, constructor_function
|
||||
, undecorated_type_id_t
|
||||
);
|
||||
|
||||
BOOST_PYTHON_DECL PyTypeObject*& class_object(undecorated_type_id_t key);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ void implicitly_convertible(boost::type<Source>* = 0, boost::type<Target>* = 0)
|
||||
{
|
||||
typedef converter::implicit<Source,Target> functions;
|
||||
|
||||
converter::registry::insert(
|
||||
converter::registry::push_back(
|
||||
&functions::convertible
|
||||
, &functions::construct
|
||||
, converter::undecorated_type_id<Target>());
|
||||
|
||||
Reference in New Issue
Block a user