2020-06-30 17:04:26 +00:00
|
|
|
#ifndef MYX_BACKPORTS_CPP_HELPERS_HPP_
|
|
|
|
#define MYX_BACKPORTS_CPP_HELPERS_HPP_
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if ( __cplusplus >= 201103L )
|
2020-07-09 12:05:59 +00:00
|
|
|
#include <memory>
|
2020-06-30 17:04:26 +00:00
|
|
|
#include <type_traits>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ( __cplusplus >= 201103L ) && ( __cplusplus < 201402L )
|
|
|
|
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
template< class T >
|
|
|
|
using underlying_type_t = typename std::underlying_type< T >::type;
|
|
|
|
|
2020-07-09 12:45:32 +00:00
|
|
|
template< typename T, typename ... Args >
|
|
|
|
std::unique_ptr< T > make_unique( Args&&... args )
|
2020-07-09 12:05:59 +00:00
|
|
|
{
|
2020-07-09 12:45:32 +00:00
|
|
|
return( std::unique_ptr< T >( new T( std::forward< Args >( args )... ) ) );
|
2020-07-09 12:05:59 +00:00
|
|
|
}
|
|
|
|
|
2020-06-30 17:04:26 +00:00
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-07-09 12:45:32 +00:00
|
|
|
#if ( ( __cplusplus >= 201103L ) && ( __cplusplus < 201402L ) ) || \
|
|
|
|
( ( __cplusplus >= 201402L ) && ( __cplusplus < 201702L ) && defined( __STRICT_ANSI__ ) )
|
|
|
|
|
2020-06-30 17:04:26 +00:00
|
|
|
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
|
|
|
|
template< typename ... Ts > struct make_void { typedef void type; };
|
2021-05-30 19:19:03 +00:00
|
|
|
|
|
|
|
#ifndef __cpp_lib_void_t
|
2020-06-30 17:04:26 +00:00
|
|
|
template< typename ... Ts > using void_t = typename make_void< Ts... >::type;
|
2021-05-30 19:19:03 +00:00
|
|
|
#endif
|
2020-06-30 17:04:26 +00:00
|
|
|
|
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // ifndef MYX_BACKPORTS_CPP_HELPERS_HPP_
|