boost::serialization::null_deleter

Hi!
I am using boost::serialization::detail::null_deleter in combination
with shared_ptr (on boost 1.34/35) - and I am having a user of my
program compiling my program (on boost 1.41) who says he has to change
that line to just boost::serialization::null_deleter to get it to work.
Should I work around this with pre-processor checks, and in that case -
what versions should I look for?
Or is there a simpler fix?
thanks in advance
--
Andreas Ronnquist

AMDG Andreas Ronnquist wrote:
I am using boost::serialization::detail::null_deleter in combination with shared_ptr (on boost 1.34/35) - and I am having a user of my program compiling my program (on boost 1.41) who says he has to change that line to just boost::serialization::null_deleter to get it to work.
Should I work around this with pre-processor checks, and in that case - what versions should I look for?
Or is there a simpler fix?
If something in boost is in a namespace called detail, it's considered an implementation detail. If you use it, you're on your own as far as compatibility goes. In Christ, Steven Watanabe

Hmmm - I'd have to spend more time on it to give a good answer. In any case, the latest version in the trunk - and maybe release - I forgot has null_deleter replaced with something else to fix a bug. Robert Ramey Andreas Ronnquist wrote:
Hi!
I am using boost::serialization::detail::null_deleter in combination with shared_ptr (on boost 1.34/35) - and I am having a user of my program compiling my program (on boost 1.41) who says he has to change that line to just boost::serialization::null_deleter to get it to work.
Should I work around this with pre-processor checks, and in that case - what versions should I look for?
Or is there a simpler fix?
thanks in advance

Thanks guys (both Robert and Steven) - I managed to work my way around
it by providing a null_deleter of my own:
template<typename T>
struct null_deleter
{
void operator()(T *) const {}
};
which of course makes me able to compile/run no matter what boost
version (in this case anyway).
Thanks!
On Mon, 21 Dec 2009 16:13:02 -0800
"Robert Ramey"
Hmmm - I'd have to spend more time on it to give a good answer.
In any case, the latest version in the trunk - and maybe release - I forgot has null_deleter replaced with something else to fix a bug.
Robert Ramey
<snip>

Andreas Rönnquist wrote:
Thanks guys (both Robert and Steven) - I managed to work my way around it by providing a null_deleter of my own:
template<typename T> struct null_deleter { void operator()(T *) const {} };
This is what I was going to suggest :-) but you may find one of the following null deleters better: struct null_deleter { template<class T> void operator()(T *) const {} }; struct null_deleter { void operator()(void const *) const {} };
participants (5)
-
Andreas Ronnquist
-
Andreas Rönnquist
-
Peter Dimov
-
Robert Ramey
-
Steven Watanabe