// ***************************************************************************
// bamtools_variant.h (c) 2010 Derek Barnett, Erik Garrison
// Marth Lab, Department of Biology, Boston College
// ***************************************************************************
// bamtools_variant.h (c) 2010 Derek Barnett, Erik Garrison
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// Provides a template-based variant type
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Provides a template-based variant type
// ---------------------------------------------------------------------------
}
// This member template constructor allows you to
// instance a variant_t object with a value of any type.
template<typename T>
}
// This member template constructor allows you to
// instance a variant_t object with a value of any type.
template<typename T>
static Impl<T>* CastFromBase(ImplBase* v) {
// This upcast will fail if T is other than the T used
// with the constructor of variant_t.
static Impl<T>* CastFromBase(ImplBase* v) {
// This upcast will fail if T is other than the T used
// with the constructor of variant_t.
- Impl<T>* p = dynamic_cast<Impl<T>*> (v);
- if (p == NULL)
- throw std::invalid_argument(typeid(T).name()+std::string(" is not a valid type"));
+ Impl<T>* p = dynamic_cast< Impl<T>* > (v);
+ if ( p == NULL )
+ throw std::invalid_argument( typeid(T).name() + std::string(" is not a valid type") );