I am using the professional edition of Visual Studio 2005.

>>You could also make a template class that handles your serialization of the third party library classes (you probably want to split save/load). A >>wrapper or holder class if you will that should only exist on the stack..

I don't understand you what you mean with this. Sorry , can you explain me a little ?

Also in this moment I solved the problem with making explicit specialization for the heap_allocator template , i.e I made the following :
namespace boost
{
    namespace archive
    {
        namespace detail
        {
            template<>
            struct heap_allocator<CustomClass>
            {
                 static CustomClass* invoke()
                {
                    return static_cast<CustomClass *>( new CustomClass ); // this one uses CustomClass specific new operator
                }
            };

        }
    }
}

And I also made load/save pair for my CustomClass.

The problem is that I have a lot of such custom classes , and I should write explicit specialization for heap_allocator template for each of them. :(
So the most easier way would be to have the compiler error fixed.



On Tue, Dec 8, 2009 at 11:49 AM, Rune Lund Olesen <rune.olesen@gmail.com> wrote:
Hello

You could also make a template class that handles your serialization of the third party library classes (you probably want to split save/load). A wrapper or holder class if you will that should only exist on the stack..
That way you can serialize the classes in any way you want to - while still getting benifits from the serialization library. The downside is the added complexity and in my case i had to make sure that pointers are not released before your done serializing, since the library tracks them (otherwise the same address could be reused and the serialization library will identify it as the same object).

Not sure if that is the kind of solution you are looking for though, might be easier to have the compile error fixed.

Regards
Rune


On Tue, Dec 8, 2009 at 10:12 AM, John Emmas <johne53@tiscali.co.uk> wrote:
----- Original Message ----- From: "elizabeta petreska"


 error C2975: 'b1' : invalid template argument for
'boost::type_traits::ice_or', expected compile-time constant expression
\libs\boost\inc\boost-1_41\boost\type_traits\has_new_operator.hpp    100

I just tried compiling your code with VS8 (Express Edition) and got the same
error.  Are you also using Express Edition?

John


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users