13
0

Replace boost type traits with std version

This commit is contained in:
Alejandro Domínguez 2024-08-19 07:18:06 +02:00 committed by Robin Gareus
parent 88e38b2699
commit e326426dbc
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 7 additions and 11 deletions

View File

@ -28,7 +28,7 @@ class /*LIBAUDIOGRAPHER_API*/ ProcessContext
// This will need to be modified if if it's modified above
static const ThrowLevel throwLevel = DEFAULT_THROW_LEVEL;
BOOST_STATIC_ASSERT (boost::has_trivial_destructor<T>::value);
BOOST_STATIC_ASSERT (std::is_trivially_destructible<T>::value);
public:

View File

@ -2,7 +2,6 @@
#define AUDIOGRAPHER_TYPE_UTILS_H
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
#include <memory>
#include <algorithm>
#include <cstring>
@ -19,11 +18,11 @@ class LIBAUDIOGRAPHER_API TypeUtilsBase
protected:
template<typename T, bool b>
static void do_zero_fill(T * buffer, samplecnt_t samples, const boost::integral_constant<bool, b>&)
static void do_zero_fill(T * buffer, samplecnt_t samples, const std::bool_constant<b>&)
{ std::uninitialized_fill_n (buffer, samples, T()); }
template<typename T>
static void do_zero_fill(T * buffer, samplecnt_t samples, const boost::true_type&)
static void do_zero_fill(T * buffer, samplecnt_t samples, const std::true_type&)
{ memset (buffer, 0, samples * sizeof(T)); }
};
@ -31,11 +30,10 @@ class LIBAUDIOGRAPHER_API TypeUtilsBase
template<typename T = DefaultSampleType>
class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase
{
BOOST_STATIC_ASSERT (boost::has_trivial_destructor<T>::value);
BOOST_STATIC_ASSERT (std::is_trivially_destructible<T>::value);
typedef boost::integral_constant<bool,
boost::is_floating_point<T>::value ||
boost::is_signed<T>::value> zero_fillable;
typedef std::bool_constant<std::is_floating_point<T>::value ||
std::is_signed<T>::value> zero_fillable;
public:
/** Fill buffer with a zero value
* The value used for filling is either 0 or the value of T()

View File

@ -48,7 +48,6 @@
#include <vector>
#include <inttypes.h>
#include <boost/type_traits.hpp>
#include "lua/luastate.h"

View File

@ -94,8 +94,7 @@ struct TypeTraits
class isEnum
{
public:
//static const bool value = std::is_enum<T>::value; // C++11
static const bool value = boost::is_enum<T>::value;
static const bool value = std::is_enum<T>::value;
};