Exemple #1
0
bool
fcppt::operator<(
	fcppt::shared_ptr<
		Type1,
		Deleter
	> const &_a,
	fcppt::shared_ptr<
		Type2,
		Deleter
	> const &_b
)
{
	return
		_a.std_ptr()
		<
		_b.std_ptr();
}
Exemple #2
0
fcppt::shared_ptr<
	Type,
	Deleter
>::shared_ptr(
	fcppt::shared_ptr<
		Other,
		Deleter
	> const &_other
)
:
	impl_(
		_other.std_ptr()
	)
{
}
Exemple #3
0
void
fcppt::swap(
	fcppt::shared_ptr<
		Type,
		Deleter
	> &_a,
	fcppt::shared_ptr<
		Type,
		Deleter
	> &_b)
{
	_a.swap(
		_b
	);
}
fcppt::shared_ptr<
	Dest
> const
static_pointer_cast(
	fcppt::shared_ptr<
		Source
	> const &_ptr
)
{
	return
		fcppt::shared_ptr<
			Dest
		>(
			_ptr,
			fcppt::cast::static_downcast_ptr<
				Dest *
			>(
				_ptr.get_pointer()
			)
		);
}
Exemple #5
0
fcppt::shared_ptr<
Dest
>
const_pointer_cast(
    fcppt::shared_ptr<
    Source const
    > const &_ptr
)
{
    return
        fcppt::shared_ptr<
        Dest
        >(
            _ptr,
            const_cast<
            Dest *
            >(
                _ptr.get_pointer()
            )
        );
}
Exemple #6
0
fcppt::shared_ptr<
	Dest
>
static_pointer_cast(
	fcppt::shared_ptr<
		Source
	> const &_ptr
)
{
	return
		fcppt::shared_ptr<
			Dest
		>(
			_ptr,
			static_cast<
				Dest *
			>(
				_ptr.get_pointer()
			)
		);
}
Exemple #7
0
fcppt::shared_ptr<
	Type,
	Deleter
>::shared_ptr(
	fcppt::shared_ptr<
		Other
	> const & _other,
	pointer const _data
)
:
	impl_(
		_other.std_ptr(),
		_data
	)
{
	static_assert(
		std::is_same<
			Deleter,
			fcppt::default_deleter
		>::value,
		"storing a different pointer in a shared_ptr only works with default_deleter"
	);
}