Boost logo

Boost Users :

From: Frank (opcode_at_[hidden])
Date: 2005-11-04 16:19:07


João Abecasis <jpabecasis <at> gmail.com> writes:

>
> Frank wrote:
> > I 'm trying to put the implementation into a dll and mark the explicit
> > instantiation of Normal as exported with the following results:
> > 1) With the small_dim_ctor's enabled I get the static assertion when marked
> > for export
> > 2) With the small_dim_ctor's enabled everything is ok when not marked for
> > export
> > 3) With the small_dim_ctor's disabled everything is ok regardless of export
> > marking
> > 4) If I comment out the BOOST_STATIC_ASSERT and build my app with export
> > enabled I can use the resulting dll without any problems
> >
> > I'm thinking that marking for export is somewhow generating an implicit
> > conversion somewhere but I don't know how.
>
> I suppose marking the class for export could instantiate all member
> functions and constructors and thus trigger the static assertions.
>
> Have you considered using boost::enable_if instead of BOOST_STATIC_ASSERT?
>
> Regards,
>
> João Abecasis
>

I thought I was only marking the explicit specialization of a single method (
eg Normal) for exporting or maybe it's because its not possible to specialize
just one method.?

After reading your reply I had a look at enable_if but I couldn't figure a way
to test the DIM
ie

template <typename T>
explicit Vector( T x, typename boost::enable_if< DIM==1, void*>::type = 0 )
 {
 data_[0]=x;
 }

but I'm not sure I understand how to use it and am still surfing for examples.

Thanks for the help.

Frank


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net