Boost logo

Boost :

From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2005-11-12 18:55:50


Pavel Vozenilek wrote:
> "Robert Ramey" wrote:
>
>> a) I'm not sure about the portability of enable_if. Would this not break
>> the whole serialization system for those compilers which don't support it?
>>
> Yes: BCB, VC6, VC7 as example.

FWIW, you don't need enable_if<> for this. Just use tag-dispatching:

  template<class Archive, class U>
  inline void save_aux(
      Archive & ar, const STD::valarray<U> &t, const
    , unsigned int file_version
    , mpl::true_
  )
  {
      ...
  }

  template<class Archive, class U>
  inline void save_aux(
      Archive & ar, const STD::valarray<U> &t, const
    , unsigned int file_version
    , mpl::false_
  )
  {
      ...
  }

  template<class Archive, class U>
  inline void save(
      Archive & ar, const STD::valarray<U> &t, const
    , unsigned int file_version
  )
  {
      save_aux(
          ar, t, file_version
        , boost::archive::has_fast_array_serialization<Archive,U>()
      );
  }

-- 
Daniel Wallin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk