mirror of
https://github.com/boostorg/serialization.git
synced 2026-01-24 06:22:08 +00:00
fix for borland
[SVN r35450]
This commit is contained in:
@@ -22,24 +22,45 @@
|
||||
// a new type. BOOST_STRONG_TYPEDEF(T, D) creates a new type named D
|
||||
// that operates as a type T.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/operators.hpp>
|
||||
|
||||
#define BOOST_STRONG_TYPEDEF(T, D) \
|
||||
struct D \
|
||||
: boost::totally_ordered1< D \
|
||||
, boost::totally_ordered2< D, T \
|
||||
> > \
|
||||
{ \
|
||||
T t; \
|
||||
explicit D(const T t_) : t(t_) {}; \
|
||||
D(){}; \
|
||||
D(const D & t_) : t(t_.t){} \
|
||||
D & operator=(const D & rhs) { t = rhs.t; return *this;} \
|
||||
D & operator=(const T & rhs) { t = rhs; return *this;} \
|
||||
operator const T & () const {return t; } \
|
||||
operator T & () { return t; } \
|
||||
bool operator==(const D & rhs) const { return t == rhs.t; } \
|
||||
bool operator<(const D & rhs) const { return t < rhs.t; } \
|
||||
};
|
||||
#if !defined(__BORLANDC__)
|
||||
#define BOOST_STRONG_TYPEDEF(T, D) \
|
||||
struct D \
|
||||
: boost::totally_ordered1< D \
|
||||
, boost::totally_ordered2< D, T \
|
||||
> > \
|
||||
{ \
|
||||
T t; \
|
||||
explicit D(const T t_) : t(t_) {}; \
|
||||
D(){}; \
|
||||
D(const D & t_) : t(t_.t){} \
|
||||
D & operator=(const D & rhs) { t = rhs.t; return *this;} \
|
||||
D & operator=(const T & rhs) { t = rhs; return *this;} \
|
||||
operator const T & () const {return t; } \
|
||||
operator T & () { return t; } \
|
||||
bool operator==(const D & rhs) const { return t == rhs.t; } \
|
||||
bool operator<(const D & rhs) const { return t < rhs.t; } \
|
||||
};
|
||||
#else
|
||||
#define BOOST_STRONG_TYPEDEF(T, D) \
|
||||
struct D \
|
||||
: boost::totally_ordered1< D \
|
||||
, boost::totally_ordered2< D, T \
|
||||
> > \
|
||||
{ \
|
||||
T t; \
|
||||
explicit D(const T t_) : t(t_) {}; \
|
||||
D(){}; \
|
||||
D(const D & t_) : t(t_.t){} \
|
||||
D & operator=(const D & rhs) { t = rhs.t; return *this;} \
|
||||
D & operator=(const T & rhs) { t = rhs; return *this;} \
|
||||
/*operator const T & () const {return t; }*/ \
|
||||
operator T & () { return t; } \
|
||||
bool operator==(const D & rhs) const { return t == rhs.t; } \
|
||||
bool operator<(const D & rhs) const { return t < rhs.t; } \
|
||||
};
|
||||
#endif // !defined(__BORLANDC)
|
||||
|
||||
#endif // BOOST_STRONG_TYPEDEF_HPP
|
||||
|
||||
Reference in New Issue
Block a user