Compatibility

Seadex essentials contains features to make it possible to compile code as C++11 or C++03 without losing C++11 advantages when compiling as C++11. Use of most of the features requires you to use Boost.

Macros

The library provies the following macros to replace some types and keywords.

essentials

C++11

C++03

SX_OVERRIDE

override

 

SX_FINAL

final

 

SX_DELETE

= delete

 

SX_NULLPTR

nullptr

 

SX_FOR

for

BOOST_FOREACH

SX_CONSTEXPR

constexpr

const

SX_NOEXCEPT

noexcept

throw()

SX_UNIQUE_PTR

std::unique_ptr

boost::shared_ptr

SX_MAKE_SHARED

std::make_shared

boost::make_shared

SX_MAKE_UNIQUE

std::make_unique

sxe::make_unique (with SX_NO_STD_MAKE_UNIQUE defined)

boost::make_shared

For C++11 - if SX_NO_STD_MAKE_UNIQUE is defined - the following template function is used instead of 'std::make_unique':

template< typename t, typename ... args >
std::unique_ptr< t > make_unique(args&& ... _args)
{
return( std::unique_ptr< t >(new t(std::forward< args >(_args)...)) );
}

For Visual Studio 2013 or older SX_CONSTEXPR represents 'const', while for Visual Studio 2015 and newer versions it represents 'constexpr'.

Also, for Visual Studio 2013 or older SX_NOEXCEPT represents 'throw()', while for Visual Studio 2015 and newer versions it represents 'noexcept'.

Bind

The following types map between the std and the boost implementation:

essentials

C++11

C++03

sxe::bind

std::bind

boost::bind

sxe::_1

std::placeholders::_1

boost::placeholders::_1

sxe::_2

std::placeholders::_2

boost::placeholders::_2

sxe::ref

std::ref

boost:ref

sxe::cref

std::cref

boost::cref

Type traits

The following types map between the std and the boost implementation:

essentials

C++11

C++03

sxe::remove_reference

std::remove_reference

boost::remove_reference

sxe::remove_const

std::remove_const

boost:remove_const

Data types

The following types map between the std and the boost implementation:

essentials

C++11

C++03

sxe::int8_t

std::int8_t

boost::int8_t

sxe::int16_t

std::int16_t

boost::int16_t

sxe::int32_t

std::int32_t

boost::int32_t

sxe::int64_t

std::int64_t

boost::int64_t

sxe::uint8_t

std::uint8_t

boost::uint8_t

sxe::uint16_t

std::uint16_t

boost::uint16_t

sxe::uint32_t

std::uint32_t

boost::uint32_t

sxe::uint64_t

std::uint64_t

boost::uint64_t

Miscellaneous

The following types map between a std and a boost implementation:

essentials

C++11

C++03

sxe::random_device

std::random_device

boost::random_device

sxe::function

std::function

boost::function

sxe::move

std::move

template<typename _type>
_type& move(_type& _t)
{
return( _t );
}