Merge branch 'master' into feature/bip-buffer-spsc-atomic

# Conflicts:
#	test/vs2019/etl.vcxproj.filters
This commit is contained in:
John Wellbelove 2021-08-02 12:22:01 +01:00
commit 0d5f30b97e
50 changed files with 9721 additions and 2868 deletions

3
.gitignore vendored
View File

@ -315,3 +315,6 @@ test/sanity-check/c++17/Makefile
test/vs2019/Debug LLVM
test/vs2019/DebugLLVMNoSTL
test/vs2019/DebugNoSTL
test/vs2022/Debug LLVM
test/vs2019/Debug MSVC - No STL - Built-ins/etl.exe
test/vs2019/Debug-LLVM-NoSTL-Builtins/etl.exe

View File

@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>5</nTsel>
<nTsel>6</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>

View File

@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>STM32F401RETx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
<PackID>Keil.STM32F4xx_DFP.2.15.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x18000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -452,7 +453,7 @@
<file attr="config" category="source" condition="STM32F401xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f401xe.s" version="2.6.0">
<instance index="0">RTE\Device\STM32F401RETx\startup_stm32f401xe.s</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
<package name="STM32F4xx_DFP" schemaVersion="1.6.3" url="http://www.keil.com/pack/" vendor="Keil" version="2.15.0"/>
<targetInfos>
<targetInfo name="Target 1"/>
</targetInfos>
@ -460,7 +461,7 @@
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.0">
<instance index="0">RTE\Device\STM32F401RETx\system_stm32f4xx.c</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
<package name="STM32F4xx_DFP" schemaVersion="1.6.3" url="http://www.keil.com/pack/" vendor="Keil" version="2.15.0"/>
<targetInfos>
<targetInfo name="Target 1"/>
</targetInfos>
@ -468,4 +469,19 @@
</files>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

View File

@ -181,7 +181,7 @@ namespace etl
protected:
//*************************************************************************
/// Construccts the buffer.
/// Constructs the buffer.
//*************************************************************************
bip_buffer_spsc_atomic_base(size_type reserved_)
: read(0)

View File

@ -41,6 +41,10 @@ SOFTWARE.
#include "iterator.h"
#include "static_assert.h"
#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
#include <initializer_list>
#endif
namespace etl
{
//***************************************************************************

View File

@ -107,7 +107,7 @@ namespace etl
//*************************************************************************
// Constructor from lambda or functor.
//*************************************************************************
template <typename TLambda, typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
template <typename TLambda, typename = etl::enable_if_t<etl::is_class<TLambda>::value, void>>
delegate(const TLambda& instance)
{
assign((void*)(&instance), lambda_stub<TLambda>);
@ -125,7 +125,7 @@ namespace etl
//*************************************************************************
/// Create from Lambda or Functor.
//*************************************************************************
template <typename TLambda, typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
template <typename TLambda, typename = etl::enable_if_t<etl::is_class<TLambda>::value, void>>
constexpr static delegate create(const TLambda& instance)
{
return delegate((void*)(&instance), lambda_stub<TLambda>);
@ -210,7 +210,7 @@ namespace etl
//*************************************************************************
/// Create from Lambda or Functor.
//*************************************************************************
template <typename TLambda, typename = typename etl::enable_if<etl::is_class<TLambda>::value, void>::type>
template <typename TLambda, typename = etl::enable_if_t<etl::is_class<TLambda>::value, void>>
delegate& operator =(const TLambda& instance)
{
assign((void*)(&instance), lambda_stub<TLambda>);

View File

@ -46,22 +46,70 @@ namespace etl
{
//***************************************************************************
/// An indexed delegate service.
/// \tparam RANGE The number of delegates to handle.
/// \tparam OFFSET The lowest delegate id value.
/// The delegate ids must range between OFFSET and OFFSET + RANGE - 1.
/// \tparam Range The number of delegates to handle.
/// \tparam Offset The lowest delegate id value.
/// \tparam Delegates Pointer to an array of delegate pointers.
/// The delegate ids must range between Offset and Offset + Range - 1.
//***************************************************************************
template <const size_t RANGE, const size_t OFFSET = 0U>
template <const size_t Range,
const size_t Offset = 0U,
const etl::delegate<void(size_t)>* Delegates = nullptr>
class delegate_service
{
public:
//*************************************************************************
/// Reset the delegate service.
/// Executes the delegate function for the index.
/// Compile time assert if the id is out of range.
/// \tparam Id The id of the delegate.
//*************************************************************************
template <const size_t Id>
void call() const
{
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
ETL_STATIC_ASSERT(Id >= Offset, "Callback Id out of range");
Delegates[Id - Offset](Id);
}
//*************************************************************************
/// Executes the delegate function for the index.
/// \param id Id of the delegate.
//*************************************************************************
void call(const size_t id) const
{
if ((id >= Offset) && (id < (Offset + Range)))
{
// Call the delegate with the specified Id.
Delegates[id - Offset](id);
}
else
{
// Call the 'unhandled' delegate.
Delegates[Range](id);
}
}
};
//***************************************************************************
/// An indexed delegate service.
/// \tparam Range The number of delegates to handle.
/// \tparam Offset The lowest delegate id value.
/// The delegate ids must range between Offset and Offset + Range - 1.
//***************************************************************************
template <const size_t Range,
const size_t Offset>
class delegate_service<Range, Offset, nullptr>
{
public:
//*************************************************************************
/// Default constructor.
/// Sets all delegates to the internal default.
//*************************************************************************
delegate_service()
{
etl::delegate<void(size_t)> default_delegate = etl::delegate<void(size_t)>::create<delegate_service<RANGE, OFFSET>, &delegate_service<RANGE, OFFSET>::unhandled>(*this);
etl::delegate<void(size_t)> default_delegate = etl::delegate<void(size_t)>::create<delegate_service<Range, Offset>, &delegate_service<Range, Offset>::unhandled>(*this);
lookup.fill(default_delegate);
}
@ -69,16 +117,16 @@ namespace etl
//*************************************************************************
/// Registers a delegate for the specified id.
/// Compile time assert if the id is out of range.
/// \tparam ID The id of the delegate.
/// \tparam Id The id of the delegate.
/// \param delegate Reference to the delegate.
//*************************************************************************
template <const size_t ID>
template <const size_t Id>
void register_delegate(etl::delegate<void(size_t)> callback)
{
ETL_STATIC_ASSERT(ID < (OFFSET + RANGE), "Callback Id out of range");
ETL_STATIC_ASSERT(ID >= OFFSET, "Callback Id out of range");
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
ETL_STATIC_ASSERT(Id >= Offset, "Callback Id out of range");
lookup[ID - OFFSET] = callback;
lookup[Id - Offset] = callback;
}
//*************************************************************************
@ -89,9 +137,9 @@ namespace etl
//*************************************************************************
void register_delegate(const size_t id, etl::delegate<void(size_t)> callback)
{
if ((id >= OFFSET) && (id < (OFFSET + RANGE)))
if ((id >= Offset) && (id < (Offset + Range)))
{
lookup[id - OFFSET] = callback;
lookup[id - Offset] = callback;
}
}
@ -107,33 +155,32 @@ namespace etl
//*************************************************************************
/// Executes the delegate function for the index.
/// Compile time assert if the id is out of range.
/// \tparam ID The id of the delegate.
/// \tparam Id The id of the delegate.
//*************************************************************************
template <const size_t ID>
void call()
template <const size_t Id>
void call() const
{
ETL_STATIC_ASSERT(ID < (OFFSET + RANGE), "Callback Id out of range");
ETL_STATIC_ASSERT(ID >= OFFSET, "Callback Id out of range");
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
ETL_STATIC_ASSERT(Id >= Offset, "Callback Id out of range");
lookup[ID - OFFSET](ID);
lookup[Id - Offset](Id);
}
//*************************************************************************
/// Executes the delegate function for the index.
/// \param id Id of the delegate.
//*************************************************************************
void call(const size_t id)
void call(const size_t id) const
{
if ((id >= OFFSET) && (id < (OFFSET + RANGE)))
if ((id >= Offset) && (id < (Offset + Range)))
{
lookup[id - OFFSET](id);
// Call the delegate with the specified Id.
lookup[id - Offset](id);
}
else
{
if (unhandled_delegate.is_valid())
{
unhandled_delegate(id);
}
// Call the 'unhandled' delegate.
unhandled(id);
}
}
@ -143,7 +190,7 @@ namespace etl
/// The default callback function.
/// Calls the user defined 'unhandled' callback if it exists.
//*************************************************************************
void unhandled(size_t id)
void unhandled(size_t id) const
{
if (unhandled_delegate.is_valid())
{
@ -155,7 +202,7 @@ namespace etl
etl::delegate<void(size_t)> unhandled_delegate;
/// Lookup table of delegates.
etl::array<etl::delegate<void(size_t)>, RANGE> lookup;
etl::array<etl::delegate<void(size_t)>, Range> lookup;
};
}

View File

@ -0,0 +1,78 @@
#pragma once
template <size_t Size_>
class uni_type
{
public:
static constexpr size_t Size = Size_;
//***********************************
template <typename T>
T& get()
{
return *reinterpret_cast<T*>(buffer);
}
//***********************************
template <typename T>
const T& get() const
{
return *reinterpret_cast<T*>(buffer);
}
template <typename T>
operator T()
{
return *reinterpret_cast<T*>(buffer);
}
//***********************************
constexpr size_t size() const
{
return Size;
}
private:
char buffer[Size]
};
template <size_t Size_>
class uni_type_ptr
{
public:
static constexpr size_t Size = Size_;
//***********************************
template <typename T>
T& get()
{
return *reinterpret_cast<T*>(pbuffer);
}
//***********************************
template <typename T>
const T& get() const
{
return *reinterpret_cast<T*>(pbuffer);
}
template <typename T>
operator T()
{
return *reinterpret_cast<T*>(pbuffer);
}
//***********************************
constexpr size_t size() const
{
return Size;
}
private:
char* pbuffer;
};

View File

@ -232,7 +232,6 @@ namespace etl
}
//***************************************************************************
template <typename TFunction >
class binder2nd : public etl::unary_function<typename TFunction::first_argument_type, typename TFunction::result_type>
{

View File

@ -395,6 +395,14 @@ namespace etl
using largest_t = typename largest<T...>::type;
#endif
#if ETL_CPP17_SUPPORTED
template <typename... T>
inline constexpr size_t largest_size_v = largest<T...>::size;
template <typename... T>
inline constexpr size_t largest_alignment_v = largest<T...>::alignment;
#endif
#else
/*[[[cog
import cog

View File

@ -135,6 +135,9 @@ namespace etl
/// remove_reference
template <typename T> struct remove_reference { typedef T type; };
template <typename T> struct remove_reference<T&> { typedef T type; };
#if ETL_CPP11_SUPPORTED
template <typename T> struct remove_reference<T&&> { typedef T type; };
#endif
#if ETL_CPP11_SUPPORTED
template <typename T>
@ -449,61 +452,16 @@ namespace etl
inline constexpr bool is_pod_v = etl::is_pod<T>::value;
#endif
//***************************************************************************
/// is_trivially_constructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_constructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_copy_constructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_destructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_destructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
/// Only POD types are recognised.
template <typename T> struct is_trivially_copy_assignable : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
#endif
//***************************************************************************
/// is_trivially_copyable
/// Only POD types are recognised.
template <typename T> struct is_trivially_copyable : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
//***************************************************************************
/// conditional
template <bool B, typename T, typename F> struct conditional { typedef T type; };
template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };
#if ETL_CPP11_SUPPORTED
template <bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type;
#endif
//***************************************************************************
/// make_signed
template <typename T> struct make_signed { typedef T type; };
@ -645,7 +603,7 @@ namespace etl
/// is_base_of
template<typename TBase,
typename TDerived,
const bool IsFundamental = (etl::is_fundamental<TBase>::value || etl::is_fundamental<TDerived>::value)>
const bool IsFundamental = (etl::is_fundamental<TBase>::value || etl::is_fundamental<TDerived>::value || etl::is_array<TDerived>::value)>
struct is_base_of
{
private:
@ -653,8 +611,10 @@ namespace etl
template<typename T> struct dummy {};
struct internal: TDerived, dummy<int>{};
static TBase* check(TBase*);
template<typename T> static char check(dummy<T>*);
static TBase* check(TBase*) { return (TBase*)0; }
template<typename T>
static char check(dummy<T>*) { return 0; }
public:
@ -781,6 +741,7 @@ namespace etl
/// Specialisation of 'alignment_of' for 'void'.
///\ingroup type_traits
template <> struct alignment_of<void> : integral_constant <size_t, 0> {};
template <> struct alignment_of<const void> : integral_constant <size_t, 0> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
@ -1094,134 +1055,17 @@ namespace etl
#endif
#endif
#if !defined(ARDUINO) && ETL_NOT_USING_STLPORT && defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED)
//***************************************************************************
/// is_trivially_constructible
///\ingroup type_traits
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = std::is_trivially_constructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
///\ingroup type_traits
template <typename T> struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_destructible
///\ingroup type_traits
template <typename T> struct is_trivially_destructible : std::is_trivially_destructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = std::is_trivially_destructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
///\ingroup type_traits
template <typename T> struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable_v<T>;
#endif
//***************************************************************************
/// is_trivially_copyable
///\ingroup type_traits
template <typename T> struct is_trivially_copyable : std::is_trivially_copyable<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = std::is_trivially_copyable_v<T>;
#endif
#else
//***************************************************************************
/// is_trivially_constructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
#else
template <typename T> struct is_trivially_constructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
#else
template <typename T> struct is_trivially_copy_constructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_destructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_destructible : std::is_trivially_destructible<T> {};
#else
template <typename T> struct is_trivially_destructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
#else
template <typename T> struct is_trivially_copy_assignable : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
#endif
//***************************************************************************
/// is_trivially_copyable
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copyable : std::is_trivially_copyable<T> {};
#else
template <typename T> struct is_trivially_copyable : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
#endif
//***************************************************************************
/// conditional
///\ingroup type_traits
template <bool B, typename T, typename F> struct conditional { typedef T type; };
template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };
#if ETL_CPP11_SUPPORTED
template <bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type;
#endif
//***************************************************************************
/// make_signed
///\ingroup type_traits
@ -1617,6 +1461,506 @@ namespace etl
#if ETL_CPP17_SUPPORTED
template <typename T, typename T1, typename... TRest>
inline constexpr bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
#endif
//***************************************************************************
/// conjunction
#if ETL_CPP11_SUPPORTED
template <typename...>
struct conjunction : public etl::true_type
{
};
template <typename T1, typename... Tn>
struct conjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), etl::conjunction<Tn...>, T1>
{
};
template <typename T>
struct conjunction<T> : public T
{
};
#endif
#if ETL_CPP17_SUPPORTED
template <typename... T>
inline constexpr bool conjunction_v = conjunction<T...>::value;
#endif
//***************************************************************************
/// disjunction
#if ETL_CPP11_SUPPORTED
template <typename...>
struct disjunction : public etl::false_type
{
};
template <typename T1, typename... Tn>
struct disjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), T1, disjunction<Tn...>>
{
};
template <typename T1> struct disjunction<T1> : public T1
{
};
#endif
#if ETL_CPP17_SUPPORTED
template <typename... T>
inline constexpr bool disjunction_v = etl::disjunction<T...>::value;
#endif
//***************************************************************************
#if ETL_CPP11_SUPPORTED && ETL_USING_STL && !defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS) && ((!defined(ARDUINO) && ETL_NOT_USING_STLPORT) || defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED))
//*********************************************
// Use the STL's definitions.
//*********************************************
//*********************************************
// is_assignable
template<typename T1, typename T2>
struct is_assignable : public std::is_assignable<T1, T2>
{
};
//*********************************************
// is_constructible
template<typename T, typename... TArgs>
struct is_constructible : public std::is_constructible<T, TArgs...>
{
};
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public std::is_copy_constructible<T>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public std::is_move_constructible<T>
{
};
//*********************************************
// is_trivially_constructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_constructible : public std::is_trivially_constructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_constructible;
template <typename T>
struct is_trivially_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_constructible<T, false>;
#endif
//***************************************************************************
// is_trivially_copy_constructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copy_constructible : public std::is_trivially_copy_constructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_constructible;
template <typename T>
struct is_trivially_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_constructible<T, false>;
#endif
//***************************************************************************
// is_trivially_destructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_destructible : public std::is_trivially_destructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_destructible;
template <typename T>
struct is_trivially_destructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_destructible<T, false>;
#endif
//***************************************************************************
// is_trivially_copy_assignable
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copy_assignable : public std::is_trivially_copy_assignable<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_assignable;
template <typename T>
struct is_trivially_copy_assignable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_assignable<T, false>;
#endif
//***************************************************************************
// is_trivially_copyable
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copyable : public std::is_trivially_copyable<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copyable;
template <typename T>
struct is_trivially_copyable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copyable<T, false>;
#endif
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS)
//*********************************************
// Use the compiler's builtins.
//*********************************************
//*********************************************
// is_assignable
template<typename T1, typename T2>
struct is_assignable : public etl::bool_constant<__is_assignable(T1, T2)>
{
};
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template<typename T, typename... TArgs>
struct is_constructible : public etl::bool_constant<__is_constructible(T, TArgs...)>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public etl::is_constructible<T, etl::add_lvalue_reference_t<const T>>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public etl::is_constructible<T, T>
{
};
//*********************************************
// is_trivially_constructible
template <typename T>
struct is_trivially_constructible : public etl::bool_constant<__is_trivially_constructible(T)>
{
};
//***************************************************************************
// is_trivially_copy_constructible
template <typename T>
struct is_trivially_copy_constructible : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
//***************************************************************************
// is_trivially_destructible
template <typename T>
struct is_trivially_destructible : public etl::bool_constant<__is_trivially_destructible(T)>
{
};
//***************************************************************************
// is_trivially_copy_assignable
template <typename T>
struct is_trivially_copy_assignable : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
//***************************************************************************
// is_trivially_copyable
template <typename T>
struct is_trivially_copyable : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
#elif defined(ETL_USER_DEFINED_TYPE_TRAITS)
//*********************************************
// Force the user to provide specialisations for
// anything other than arithmetics and pointers.
//*********************************************
//*********************************************
// is_assignable
template <typename T1,
typename T2,
bool B = (etl::is_arithmetic<T1>::value || etl::is_pointer<T1>::value) && (etl::is_arithmetic<T2>::value || etl::is_pointer<T2>::value)>
struct is_assignable;
template <typename T1, typename T2>
struct is_assignable<T1, T2, true> : public etl::true_type
{
};
template <typename T1, typename T2>
struct is_assignable<T1, T2, false>;
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template <typename T, bool B, typename... TArgs>
struct is_constructible_helper;
template <typename T, typename... TArgs>
struct is_constructible_helper<T, true, TArgs...> : public etl::true_type
{
};
template <typename T, typename... TArgs>
struct is_constructible_helper<T, false, TArgs...>;
template <typename T, typename... TArgs>
struct is_constructible : public is_constructible_helper<T, etl::is_arithmetic<T>::value || etl::is_pointer<T>::value, TArgs...>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_copy_constructible;
template <typename T>
struct is_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_copy_constructible<T, false>;
//*********************************************
// is_move_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_move_constructible;
template <typename T>
struct is_move_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_move_constructible<T, false>;
//*********************************************
// is_trivially_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_constructible;
template <typename T>
struct is_trivially_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_constructible<T, false>;
//***************************************************************************
// is_trivially_copy_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_constructible;
template <typename T>
struct is_trivially_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_constructible<T, false>;
//***************************************************************************
// is_trivially_destructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_destructible;
template <typename T>
struct is_trivially_destructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_destructible<T, false>;
//***************************************************************************
// is_trivially_copy_assignable
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_assignable;
template <typename T>
struct is_trivially_copy_assignable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_assignable<T, false>;
//***************************************************************************
// is_trivially_copyable
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copyable;
template <typename T>
struct is_trivially_copyable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copyable<T, false>;
#else
//*********************************************
// Assume that anything other than arithmetics
// and pointers return false for the traits.
//*********************************************
//*********************************************
// is_assignable
template <typename T1, typename T2>
struct is_assignable : public etl::bool_constant<(etl::is_arithmetic<T1>::value || etl::is_pointer<T1>::value) && (etl::is_arithmetic<T2>::value || etl::is_pointer<T2>::value)>
{
};
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template <typename T, typename... TArgs>
struct is_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//*********************************************
// is_trivially_constructible
template <typename T>
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copy_constructible
template <typename T>
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_destructible
template <typename T>
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copy_assignable
template <typename T>
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copyable
template <typename T>
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
#endif
template <typename T1, typename T2>
struct is_lvalue_assignable : public etl::is_assignable<typename etl::add_lvalue_reference<T1>::type,
typename etl::add_lvalue_reference<typename etl::add_const<T2>::type>::type>
{
};
#if ETL_CPP17_SUPPORTED
template <typename T1, typename T2>
inline constexpr bool is_assignable_v = etl::is_assignable<T1, T2>::value;
template <typename T1, typename T2>
inline constexpr bool is_lvalue_assignable_v = etl::is_lvalue_assignable<T1, T2>::value;
template<typename T, typename... TArgs>
inline constexpr bool is_constructible_v = etl::is_constructible<T, TArgs...>::value;
template<typename T>
inline constexpr bool is_copy_constructible_v = etl::is_copy_constructible<T>::value;
template<typename T>
inline constexpr bool is_move_constructible_v = etl::is_move_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
}

89
include/etl/overload.h Normal file
View File

@ -0,0 +1,89 @@
///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#ifndef ETL_OVERLOAD_INCLUDED
#define ETL_OVERLOAD_INCLUDED
#include "platform.h"
#include "utility.h"
#include "type_traits.h"
namespace etl
{
#if ETL_CPP11_SUPPORTED
#if ETL_CPP17_SUPPORTED && !defined(ETL_OVERLOAD_FORCE_CPP14)
//*************************************************************************
/// Variadic template definition of overload for C++17 and above.
//*************************************************************************
template<typename... TOverloads>
struct overload : TOverloads...
{
using TOverloads::operator()...;
};
//*************************************************************************
/// Template deduction guide.
//*************************************************************************
template<typename... TOverloads> overload(TOverloads...)->overload<TOverloads...>;
#else
//*************************************************************************
/// Variadic template definition of overload for C++14.
//*************************************************************************
template <typename TFirst, typename... TOthers>
struct overload : TFirst, overload<TOthers...>
{
using TFirst::operator();
using overload<TOthers...>::operator();
};
template <typename TFirst>
struct overload<TFirst> : TFirst
{
using TFirst::operator();
};
#endif
//*************************************************************************
/// Make an overload.
//*************************************************************************
template <typename... TOverloads>
constexpr overload<TOverloads...> make_overload(TOverloads&&... overloads)
{
return overload<TOverloads...>{ etl::forward<TOverloads>(overloads)... };
}
#endif
}
#endif

View File

@ -77,7 +77,7 @@ namespace etl
static_assert(etl::is_one_of<T, TTypes...>::value, "T is not in parameter pack");
/// The idex value.
/// The index value.
static constexpr size_t value = index_of_type_helper<T, TTypes...>::value - 1;
};
@ -120,6 +120,14 @@ namespace etl
template <size_t I>
using type_from_index_t = typename type_from_index<I>::type;
};
template <size_t Index, typename... TTypes>
using parameter_pack_t = typename etl::parameter_pack<TTypes...>::template type_from_index_t<Index>;
#if ETL_CPP17_SUPPORTED
template <typename T, typename... TTypes>
inline constexpr size_t parameter_pack_v = etl::parameter_pack<TTypes...>::template index_of_type<T>::value;
#endif
}
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -123,6 +123,9 @@ namespace etl
/// remove_reference
template <typename T> struct remove_reference { typedef T type; };
template <typename T> struct remove_reference<T&> { typedef T type; };
#if ETL_CPP11_SUPPORTED
template <typename T> struct remove_reference<T&&> { typedef T type; };
#endif
#if ETL_CPP11_SUPPORTED
template <typename T>
@ -437,61 +440,16 @@ namespace etl
inline constexpr bool is_pod_v = etl::is_pod<T>::value;
#endif
//***************************************************************************
/// is_trivially_constructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_constructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_copy_constructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_destructible
/// Only POD types are recognised.
template <typename T> struct is_trivially_destructible : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
/// Only POD types are recognised.
template <typename T> struct is_trivially_copy_assignable : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
#endif
//***************************************************************************
/// is_trivially_copyable
/// Only POD types are recognised.
template <typename T> struct is_trivially_copyable : etl::is_pod<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
//***************************************************************************
/// conditional
template <bool B, typename T, typename F> struct conditional { typedef T type; };
template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };
#if ETL_CPP11_SUPPORTED
template <bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type;
#endif
//***************************************************************************
/// make_signed
template <typename T> struct make_signed { typedef T type; };
@ -501,10 +459,10 @@ namespace etl
template <> struct make_signed<wchar_t>
{
typedef etl::conditional<sizeof(wchar_t) == sizeof(int16_t),
int16_t,
etl::conditional<sizeof(wchar_t) == sizeof(int32_t),
int32_t,
void>::type>::type type;
int16_t,
etl::conditional<sizeof(wchar_t) == sizeof(int32_t),
int32_t,
void>::type>::type type;
};
template <> struct make_signed<unsigned short> { typedef short type; };
@ -633,7 +591,7 @@ namespace etl
/// is_base_of
template<typename TBase,
typename TDerived,
const bool IsFundamental = (etl::is_fundamental<TBase>::value || etl::is_fundamental<TDerived>::value)>
const bool IsFundamental = (etl::is_fundamental<TBase>::value || etl::is_fundamental<TDerived>::value || etl::is_array<TDerived>::value)>
struct is_base_of
{
private:
@ -641,8 +599,10 @@ namespace etl
template<typename T> struct dummy {};
struct internal: TDerived, dummy<int>{};
static TBase* check(TBase*);
template<typename T> static char check(dummy<T>*);
static TBase* check(TBase*) { return (TBase*)0; }
template<typename T>
static char check(dummy<T>*) { return 0; }
public:
@ -769,6 +729,7 @@ namespace etl
/// Specialisation of 'alignment_of' for 'void'.
///\ingroup type_traits
template <> struct alignment_of<void> : integral_constant <size_t, 0> {};
template <> struct alignment_of<const void> : integral_constant <size_t, 0> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
@ -1082,134 +1043,17 @@ namespace etl
#endif
#endif
#if !defined(ARDUINO) && ETL_NOT_USING_STLPORT && defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED)
//***************************************************************************
/// is_trivially_constructible
///\ingroup type_traits
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = std::is_trivially_constructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
///\ingroup type_traits
template <typename T> struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_destructible
///\ingroup type_traits
template <typename T> struct is_trivially_destructible : std::is_trivially_destructible<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = std::is_trivially_destructible_v<T>;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
///\ingroup type_traits
template <typename T> struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable_v<T>;
#endif
//***************************************************************************
/// is_trivially_copyable
///\ingroup type_traits
template <typename T> struct is_trivially_copyable : std::is_trivially_copyable<T> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = std::is_trivially_copyable_v<T>;
#endif
#else
//***************************************************************************
/// is_trivially_constructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
#else
template <typename T> struct is_trivially_constructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_constructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copy_constructible : std::is_trivially_copy_constructible<T> {};
#else
template <typename T> struct is_trivially_copy_constructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_destructible
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_destructible : std::is_trivially_destructible<T> {};
#else
template <typename T> struct is_trivially_destructible : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
#endif
//***************************************************************************
/// is_trivially_copy_assignable
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copy_assignable : std::is_trivially_copy_assignable<T> {};
#else
template <typename T> struct is_trivially_copy_assignable : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
#endif
//***************************************************************************
/// is_trivially_copyable
///\ingroup type_traits
#if ETL_CPP11_SUPPORTED && ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T> struct is_trivially_copyable : std::is_trivially_copyable<T> {};
#else
template <typename T> struct is_trivially_copyable : std::is_pod<T> {};
#endif
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
#endif
//***************************************************************************
/// conditional
///\ingroup type_traits
template <bool B, typename T, typename F> struct conditional { typedef T type; };
template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };
#if ETL_CPP11_SUPPORTED
template <bool B, typename T, typename F>
using conditional_t = typename conditional<B, T, F>::type;
#endif
//***************************************************************************
/// make_signed
///\ingroup type_traits
@ -1355,6 +1199,7 @@ namespace etl
///\ingroup type_traits
template <typename T> struct alignment_of : std::alignment_of<T> {};
template <> struct alignment_of<void> : std::integral_constant<size_t, 0> {};
template <> struct alignment_of<const void> : integral_constant <size_t, 0> {};
#if ETL_CPP17_SUPPORTED
template <typename T>
@ -1610,6 +1455,506 @@ namespace etl
#if ETL_CPP17_SUPPORTED
template <typename T, typename T1, typename... TRest>
inline constexpr bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
#endif
//***************************************************************************
/// conjunction
#if ETL_CPP11_SUPPORTED
template <typename...>
struct conjunction : public etl::true_type
{
};
template <typename T1, typename... Tn>
struct conjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), etl::conjunction<Tn...>, T1>
{
};
template <typename T>
struct conjunction<T> : public T
{
};
#endif
#if ETL_CPP17_SUPPORTED
template <typename... T>
inline constexpr bool conjunction_v = conjunction<T...>::value;
#endif
//***************************************************************************
/// disjunction
#if ETL_CPP11_SUPPORTED
template <typename...>
struct disjunction : public etl::false_type
{
};
template <typename T1, typename... Tn>
struct disjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), T1, disjunction<Tn...>>
{
};
template <typename T1> struct disjunction<T1> : public T1
{
};
#endif
#if ETL_CPP17_SUPPORTED
template <typename... T>
inline constexpr bool disjunction_v = etl::disjunction<T...>::value;
#endif
//***************************************************************************
#if ETL_CPP11_SUPPORTED && ETL_USING_STL && !defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS) && ((!defined(ARDUINO) && ETL_NOT_USING_STLPORT) || defined(ETL_GCC_V5_TYPE_TRAITS_SUPPORTED))
//*********************************************
// Use the STL's definitions.
//*********************************************
//*********************************************
// is_assignable
template<typename T1, typename T2>
struct is_assignable : public std::is_assignable<T1, T2>
{
};
//*********************************************
// is_constructible
template<typename T, typename... TArgs>
struct is_constructible : public std::is_constructible<T, TArgs...>
{
};
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public std::is_copy_constructible<T>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public std::is_move_constructible<T>
{
};
//*********************************************
// is_trivially_constructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_constructible : public std::is_trivially_constructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_constructible;
template <typename T>
struct is_trivially_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_constructible<T, false>;
#endif
//***************************************************************************
// is_trivially_copy_constructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copy_constructible : public std::is_trivially_copy_constructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_constructible;
template <typename T>
struct is_trivially_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_constructible<T, false>;
#endif
//***************************************************************************
// is_trivially_destructible
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_destructible : public std::is_trivially_destructible<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_destructible;
template <typename T>
struct is_trivially_destructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_destructible<T, false>;
#endif
//***************************************************************************
// is_trivially_copy_assignable
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copy_assignable : public std::is_trivially_copy_assignable<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_assignable;
template <typename T>
struct is_trivially_copy_assignable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_assignable<T, false>;
#endif
//***************************************************************************
// is_trivially_copyable
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
template <typename T>
struct is_trivially_copyable : public std::is_trivially_copyable<T>
{
};
#else
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copyable;
template <typename T>
struct is_trivially_copyable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copyable<T, false>;
#endif
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
//*********************************************
// Use the compiler's builtins.
//*********************************************
//*********************************************
// is_assignable
template<typename T1, typename T2>
struct is_assignable : public etl::bool_constant<__is_assignable(T1, T2)>
{
};
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template<typename T, typename... TArgs>
struct is_constructible : public etl::bool_constant<__is_constructible(T, TArgs...)>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public etl::is_constructible<T, etl::add_lvalue_reference_t<const T>>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public etl::is_constructible<T, T>
{
};
//*********************************************
// is_trivially_constructible
template <typename T>
struct is_trivially_constructible : public etl::bool_constant<__is_trivially_constructible(T)>
{
};
//***************************************************************************
// is_trivially_copy_constructible
template <typename T>
struct is_trivially_copy_constructible : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
//***************************************************************************
// is_trivially_destructible
template <typename T>
struct is_trivially_destructible : public etl::bool_constant<__is_trivially_destructible(T)>
{
};
//***************************************************************************
// is_trivially_copy_assignable
template <typename T>
struct is_trivially_copy_assignable : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
//***************************************************************************
// is_trivially_copyable
template <typename T>
struct is_trivially_copyable : public etl::bool_constant<__is_trivially_copyable(T)>
{
};
#elif defined(ETL_USER_DEFINED_TYPE_TRAITS) && !defined(ETL_USE_TYPE_TRAITS_BUILTINS)
//*********************************************
// Force the user to provide specialisations for
// anything other than arithmetics and pointers.
//*********************************************
//*********************************************
// is_assignable
template <typename T1,
typename T2,
bool B = (etl::is_arithmetic<T1>::value || etl::is_pointer<T1>::value) && (etl::is_arithmetic<T2>::value || etl::is_pointer<T2>::value)>
struct is_assignable;
template <typename T1, typename T2>
struct is_assignable<T1, T2, true> : public etl::true_type
{
};
template <typename T1, typename T2>
struct is_assignable<T1, T2, false>;
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template <typename T, bool B, typename... TArgs>
struct is_constructible_helper;
template <typename T, typename... TArgs>
struct is_constructible_helper<T, true, TArgs...> : public etl::true_type
{
};
template <typename T, typename... TArgs>
struct is_constructible_helper<T, false, TArgs...>;
template <typename T, typename... TArgs>
struct is_constructible : public is_constructible_helper<T, etl::is_arithmetic<T>::value || etl::is_pointer<T>::value, TArgs...>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_copy_constructible;
template <typename T>
struct is_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_copy_constructible<T, false>;
//*********************************************
// is_move_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_move_constructible;
template <typename T>
struct is_move_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_move_constructible<T, false>;
//*********************************************
// is_trivially_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_constructible;
template <typename T>
struct is_trivially_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_constructible<T, false>;
//***************************************************************************
// is_trivially_copy_constructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_constructible;
template <typename T>
struct is_trivially_copy_constructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_constructible<T, false>;
//***************************************************************************
// is_trivially_destructible
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_destructible;
template <typename T>
struct is_trivially_destructible<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_destructible<T, false>;
//***************************************************************************
// is_trivially_copy_assignable
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copy_assignable;
template <typename T>
struct is_trivially_copy_assignable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copy_assignable<T, false>;
//***************************************************************************
// is_trivially_copyable
template <typename T, bool B = etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
struct is_trivially_copyable;
template <typename T>
struct is_trivially_copyable<T, true> : public etl::true_type
{
};
template <typename T>
struct is_trivially_copyable<T, false>;
#else
//*********************************************
// Assume that anything other than arithmetics
// and pointers return false for the traits.
//*********************************************
//*********************************************
// is_assignable
template <typename T1, typename T2>
struct is_assignable : public etl::bool_constant<(etl::is_arithmetic<T1>::value || etl::is_pointer<T1>::value) && (etl::is_arithmetic<T2>::value || etl::is_pointer<T2>::value)>
{
};
#if ETL_CPP11_SUPPORTED
//*********************************************
// is_constructible
template <typename T, typename... TArgs>
struct is_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
#endif
//*********************************************
// is_copy_constructible
template <typename T>
struct is_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//*********************************************
// is_move_constructible
template <typename T>
struct is_move_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//*********************************************
// is_trivially_constructible
template <typename T>
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copy_constructible
template <typename T>
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_destructible
template <typename T>
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copy_assignable
template <typename T>
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
//***************************************************************************
// is_trivially_copyable
template <typename T>
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
{
};
#endif
template <typename T1, typename T2>
struct is_lvalue_assignable : public etl::is_assignable<typename etl::add_lvalue_reference<T1>::type,
typename etl::add_lvalue_reference<typename etl::add_const<T2>::type>::type>
{
};
#if ETL_CPP17_SUPPORTED
template <typename T1, typename T2>
inline constexpr bool is_assignable_v = etl::is_assignable<T1, T2>::value;
template <typename T1, typename T2>
inline constexpr bool is_lvalue_assignable_v = etl::is_lvalue_assignable<T1, T2>::value;
template<typename T, typename... TArgs>
inline constexpr bool is_constructible_v = etl::is_constructible<T, TArgs...>::value;
template<typename T>
inline constexpr bool is_copy_constructible_v = etl::is_copy_constructible<T>::value;
template<typename T>
inline constexpr bool is_move_constructible_v = etl::is_move_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_constructible_v = etl::is_trivially_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_copy_constructible_v = etl::is_trivially_copy_constructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_destructible_v = etl::is_trivially_destructible<T>::value;
template <typename T>
inline constexpr bool is_trivially_copy_assignable_v = etl::is_trivially_copy_assignable<T>::value;
template <typename T>
inline constexpr bool is_trivially_copyable_v = etl::is_trivially_copyable<T>::value;
#endif
}

View File

@ -332,8 +332,55 @@ namespace etl
return t;
}
//******************************************************************************
//***************************************************************************
/// integer_sequence
//***************************************************************************
#if ETL_CPP11_SUPPORTED
template <typename T, T... Integers>
class integer_sequence
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Integral types only");
typedef T value_type;
static ETL_CONSTEXPR size_t size() ETL_NOEXCEPT
{
return sizeof...(Integers);
}
};
namespace private_integer_sequence
{
template <size_t N, typename IndexSeq>
struct make_index_sequence;
template <size_t N, size_t... Indices>
struct make_index_sequence<N, etl::integer_sequence<size_t, Indices...>>
{
typedef typename make_index_sequence<N - 1, etl::integer_sequence<size_t, N - 1, Indices...>>::type type;
};
template <size_t... Indices>
struct make_index_sequence<0, etl::integer_sequence<size_t, Indices...>>
{
typedef etl::integer_sequence<size_t, Indices...> type;
};
}
//***********************************
template <size_t N>
using make_index_sequence = typename private_integer_sequence::make_index_sequence<N, etl::integer_sequence<size_t>>::type;
//***********************************
template <size_t... Indices>
using index_sequence = etl::integer_sequence<size_t, Indices...>;
#endif
//***************************************************************************
/// 2D coordinate type.
//***************************************************************************
template <typename T>
struct coordinate_2d
{
@ -362,6 +409,42 @@ namespace etl
T x;
T y;
};
//***************************************************************************
/// in_place disambiguation tags.
//***************************************************************************
//*************************
struct in_place_t
{
explicit ETL_CONSTEXPR in_place_t() {}
};
#if ETL_CPP17_SUPPORTED
inline constexpr in_place_t in_place;
#endif
//*************************
template <typename T> struct in_place_type_t
{
explicit ETL_CONSTEXPR in_place_type_t(){};
};
#if ETL_CPP17_SUPPORTED
template <typename T>
inline constexpr in_place_type_t<T> in_place_type;
#endif
//*************************
template <std::size_t I> struct in_place_index_t
{
explicit ETL_CONSTEXPR in_place_index_t() {}
};
#if ETL_CPP17_SUPPORTED
template <std::size_t I>
inline constexpr in_place_index_t<I> in_place_index;
#endif
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -38,8 +38,8 @@ SOFTWARE.
///\ingroup utilities
#define ETL_VERSION_MAJOR 20
#define ETL_VERSION_MINOR 12
#define ETL_VERSION_PATCH 0
#define ETL_VERSION_MINOR 14
#define ETL_VERSION_PATCH 1
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH)

View File

@ -1,6 +1,6 @@
{
"name": "ETL Embedded Template Library",
"version": "20.12.0",
"version": "20.14.1",
"author s": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library ETL
version=20.12.0
version=20.14.1
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT

View File

@ -8,7 +8,7 @@ project('PROJECT_NAME',
'cpp_std=c++17', 'build.cpp_std=c++17',
],
meson_version: '>=0.54.0',
version: '20.12.0'
version: '20.14.1'
)
######################

View File

@ -1,3 +1,22 @@
===============================================================================
20.14.1
Changed std::forward to etl::forward in etl::variant (variadic)
===============================================================================
20.14.0
Added a vaiadic version of etl::variant. Usable for C++11 and up.
Added etl::overload pattern class. Groups lambdas into a functor class.
Refactored type_traits.h. Uses STL, compiler built-ins or user defined specialisations, dependent on settings.
Added etl::conditional_t to type_traits.h
Added etl::conjunction and etl::disjunction to type_traits.h
Added etl::integer_sequence to utility.h
Added etl::in_place, etl::in_place_t and etl::in_place_index_t.
Fixed missing etl::alignment_of specialisation for const void.
===============================================================================
20.13.0
Added a specialisation of etl::delegate_service to allow constexpr service.
===============================================================================
20.12.0
Added the option to derived etl::message<> from a parent class other than etl::imessage.

View File

@ -101,6 +101,7 @@ set(TEST_SOURCE_FILES
test_debounce.cpp
test_delegate.cpp
test_delegate_service.cpp
test_delegate_service_compile_time.cpp
test_deque.cpp
test_endian.cpp
test_enum_type.cpp
@ -237,7 +238,8 @@ set(TEST_SOURCE_FILES
test_user_type.cpp
test_utility.cpp
test_variance.cpp
test_variant.cpp
test_variant_legacy.cpp
test_variant_variadic.cpp
test_variant_pool.cpp
test_vector.cpp
test_vector_external_buffer.cpp

View File

@ -78,8 +78,6 @@ SOFTWARE.
//#define ETL_MESSAGES_ARE_VIRTUAL
//#define ETL_POLYMORPHIC_MESSAGES
//#define ETL_NO_STL
#if defined(ETL_FORCE_TEST_CPP03)
#define ETL_FUNCTION_FORCE_CPP03
#define ETL_PRIORITY_QUEUE_FORCE_CPP03
@ -98,6 +96,10 @@ SOFTWARE.
#define ETL_MEM_CAST_FORCE_CPP03
#endif
//#define ETL_OVERLOAD_FORCE_CPP11
//#define ETL_VARIANT_FORCE_CPP11
//#define ETL_VARIANT_CPP11_MAX_16_TYPES
#if defined(ETL_NO_STL)
#define ETL_TIMER_SEMAPHORE_TYPE uint32_t
#endif

View File

@ -16,22 +16,42 @@ echo "-----------------------------------------------"
echo "GCC - STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - Builtins"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - User defined traits"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - Builtins"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - User defined traits"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
###############################################################################
cd ../c++11 || exit 1
@ -44,22 +64,42 @@ echo "-----------------------------------------------"
echo "GCC - STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - Builtins"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - User defined traits"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - Builtins"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - User defined traits"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
###############################################################################
cd ../c++14 || exit 1
@ -69,27 +109,47 @@ echo "-----------------------------------------------"
echo " C++14"
echo "-----------------------------------------------"
echo " GCC - STL"; } >> ../log.txt
echo "GCC - STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - Builtins"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - User defined traits"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
###############################################################################
{ echo ""; echo "Clang - No STL - Builtins"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - User defined traits"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
###############################################################################
cd ../c++17 || exit 1
cmake -E make_directory bgcc bclang
{ echo ""
@ -100,22 +160,42 @@ echo "-----------------------------------------------"
echo "GCC - STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bgcc || echo "**** Failed ****" >> ../log.txt
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - Builtins"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "GCC - No STL - User defined traits"; } >> ../log.txt
g++ --version | head --lines=1 >> ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bgcc || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=OFF ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON ..
cmake --build bclang || echo "**** Failed ****" >> ../log.txt
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - Builtins"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""; echo "Clang - No STL - User defined traits"; } >> ../log.txt
clang++ --version | head --lines=1 >> ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake --cmake-clean-cache -DNO_STL=ON -DETL_USER_DEFINED_TYPE_TRAITS=ON ..
cmake --build bclang || echo "****************\n**** Failed ****\n****************" >> ../log.txt
{ echo ""
echo "-----------------------------------------------"

View File

@ -2,40 +2,56 @@
#sudo ntpdate ntp.ubuntu.com
cd build || exit 1
echo "ETL Tests" > etl_test_log.txt
echo "ETL Tests" > log.txt
echo ""
echo "-----------------------------------------------" >> etl_test_log.txt
echo " GCC" >> etl_test_log.txt
echo "-----------------------------------------------" >> etl_test_log.txt
gcc --version | grep gcc >> etl_test_log.txt
echo "-----------------------------------------------" >> log.txt
echo " GCC" >> log.txt
echo "-----------------------------------------------" >> log.txt
gcc --version | grep gcc >> log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=OFF ..
make -j8
./etl_tests | tee etl_test_log.txt
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> etl_test_log.txt
echo " GCC - No STL" >> etl_test_log.txt
echo "-----------------------------------------------" >> etl_test_log.txt
gcc --version | grep gcc >> etl_test_log.txt
echo "-----------------------------------------------" >> log.txt
echo " GCC - No STL" >> log.txt
echo "-----------------------------------------------" >> log.txt
gcc --version | grep gcc >> log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON ..
make -j8
./etl_tests | tee etl_test_log.txt
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> etl_test_log.txt
echo " Clang" >> etl_test_log.txt
echo "-----------------------------------------------" >> etl_test_log.txt
clang --version | grep clang >> etl_test_log.txt
echo "-----------------------------------------------" >> log.txt
echo " GCC - No STL - Builtins" >> log.txt
echo "-----------------------------------------------" >> log.txt
gcc --version | grep gcc >> log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> log.txt
echo " Clang" >> log.txt
echo "-----------------------------------------------" >> log.txt
clang --version | grep clang >> log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=OFF ..
make -j8
./etl_tests | tee etl_test_log.txt
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> etl_test_log.txt
echo " Clang - No STL" >> etl_test_log.txt
echo "-----------------------------------------------" >> etl_test_log.txt
clang --version | grep clang >> etl_test_log.txt
echo "-----------------------------------------------" >> log.txt
echo " Clang - No STL" >> log.txt
echo "-----------------------------------------------" >> log.txt
clang --version | grep clang >> log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON ..
make -j8
./etl_tests | tee etl_test_log.txt
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> etl_test_log.txt
echo " Tests Completed" >> etl_test_log.txt
echo "-----------------------------------------------" >> etl_test_log.txt
echo "-----------------------------------------------" >> log.txt
echo " Clang - No STL - Builtins" >> log.txt
echo "-----------------------------------------------" >> log.txt
clang --version | grep clang >> log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON ..
make -j8 || echo "****************\n**** Failed ****\n****************" >> ../log.txt
./etl_tests | tee log.txt
echo ""
echo "-----------------------------------------------" >> log.txt
echo " Tests Completed" >> log.txt
echo "-----------------------------------------------" >> log.txt

View File

@ -174,6 +174,7 @@ target_sources(t98 PRIVATE etl_profile.h
../numeric.h.t.cpp
../observer.h.t.cpp
../optional.h.t.cpp
../overload.h.t.cpp
../packet.h.t.cpp
../parameter_pack.h.t.cpp
../parameter_type.h.t.cpp
@ -243,7 +244,8 @@ target_sources(t98 PRIVATE etl_profile.h
../user_type.h.t.cpp
../utility.h.t.cpp
../variance.h.t.cpp
../variant.h.t.cpp
../variant_legacy.h.t.cpp
../variant_variadic.h.t.cpp
../variant_pool.h.t.cpp
../vector.h.t.cpp
../version.h.t.cpp

View File

@ -174,6 +174,7 @@ target_sources(t11 PRIVATE etl_profile.h
../numeric.h.t.cpp
../observer.h.t.cpp
../optional.h.t.cpp
../overload.h.t.cpp
../packet.h.t.cpp
../parameter_pack.h.t.cpp
../parameter_type.h.t.cpp
@ -243,7 +244,8 @@ target_sources(t11 PRIVATE etl_profile.h
../user_type.h.t.cpp
../utility.h.t.cpp
../variance.h.t.cpp
../variant.h.t.cpp
../variant_legacy.h.t.cpp
../variant_variadic.h.t.cpp
../variant_pool.h.t.cpp
../vector.h.t.cpp
../version.h.t.cpp

View File

@ -174,6 +174,7 @@ target_sources(t14 PRIVATE etl_profile.h
../numeric.h.t.cpp
../observer.h.t.cpp
../optional.h.t.cpp
../overload.h.t.cpp
../packet.h.t.cpp
../parameter_pack.h.t.cpp
../parameter_type.h.t.cpp
@ -243,7 +244,8 @@ target_sources(t14 PRIVATE etl_profile.h
../user_type.h.t.cpp
../utility.h.t.cpp
../variance.h.t.cpp
../variant.h.t.cpp
../variant_legacy.h.t.cpp
../variant_variadic.h.t.cpp
../variant_pool.h.t.cpp
../vector.h.t.cpp
../version.h.t.cpp

View File

@ -174,6 +174,7 @@ target_sources(t17 PRIVATE etl_profile.h
../numeric.h.t.cpp
../observer.h.t.cpp
../optional.h.t.cpp
../overload.h.t.cpp
../packet.h.t.cpp
../parameter_pack.h.t.cpp
../parameter_type.h.t.cpp
@ -243,7 +244,8 @@ target_sources(t17 PRIVATE etl_profile.h
../user_type.h.t.cpp
../utility.h.t.cpp
../variance.h.t.cpp
../variant.h.t.cpp
../variant_legacy.h.t.cpp
../variant_variadic.h.t.cpp
../variant_pool.h.t.cpp
../vector.h.t.cpp
../version.h.t.cpp

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/overload.h>

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/private/variant_legacy.h>

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/private/variant_old.h>

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/private/variant_variadic.h>

View File

@ -133,13 +133,13 @@ namespace
void member_reference(const Data& data, int j)
{
function_called = true;
parameter_correct = (data.d == VALUE1) && (j = VALUE2);
parameter_correct = (data.d == VALUE1) && (j == VALUE2);
}
void member_reference_const(const Data& data, int j) const
{
function_called = true;
parameter_correct = (data.d == VALUE1) && (j = VALUE2);
parameter_correct = (data.d == VALUE1) && (j == VALUE2);
}
//*******************************************
@ -155,7 +155,7 @@ namespace
static void member_static(const Data& data, int j)
{
function_called = true;
parameter_correct = (data.d == VALUE1) && (j = VALUE2);
parameter_correct = (data.d == VALUE1) && (j == VALUE2);
}
//*******************************************

View File

@ -33,10 +33,10 @@ SOFTWARE.
namespace
{
const size_t SIZE = 3U;
const size_t OFFSET = 5U;
const size_t Size = 3U;
const size_t Offset = 5U;
using Service = etl::delegate_service<SIZE, OFFSET>;
using Service = etl::delegate_service<Size, Offset>;
//*****************************************************************************
bool global_called = false;
@ -94,13 +94,13 @@ namespace
Test test;
// Callback for 'member2'.
etl::delegate<void(size_t)> member_callback = etl::delegate<void(size_t)>::create<Test, test, &Test::member2>();
constexpr etl::delegate<void(size_t)> member_callback = etl::delegate<void(size_t)>::create<Test, test, &Test::member2>();
// Callback for 'global'.
etl::delegate<void(size_t)> global_callback = etl::delegate<void(size_t)>::create<global>();
constexpr etl::delegate<void(size_t)> global_callback = etl::delegate<void(size_t)>::create<global>();
// Callback for 'unhandled'.
etl::delegate<void(size_t)> unhandled_callback = etl::delegate<void(size_t)>::create<unhandled>();
constexpr etl::delegate<void(size_t)> unhandled_callback = etl::delegate<void(size_t)>::create<unhandled>();
//*****************************************************************************
// Initialises the test results.
@ -109,10 +109,10 @@ namespace
{
SetupFixture()
{
called_id = UINT_MAX;
global_called = false;
member1_called = false;
member2_called = false;
called_id = UINT_MAX;
global_called = false;
member1_called = false;
member2_called = false;
unhandled_called = false;
}
};
@ -122,10 +122,10 @@ namespace
{
enum
{
GLOBAL = OFFSET,
MEMBER1,
MEMBER2,
OUT_OF_RANGE
Global = Offset,
Member1,
Member2,
Out_Of_Range
};
SUITE(test_delegate_service)
@ -135,13 +135,13 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER1>(test.callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member1>(test.callback);
service.register_delegate<Member2>(member_callback);
service.call<GLOBAL>();
service.call<Global>();
CHECK_EQUAL(GLOBAL, called_id);
CHECK_EQUAL(Global, called_id);
CHECK(global_called);
CHECK(!member1_called);
CHECK(!member2_called);
@ -153,13 +153,13 @@ namespace
{
Service service;
service.register_delegate(GLOBAL, global_callback);
service.register_delegate(MEMBER1, test.callback);
service.register_delegate(MEMBER2, member_callback);
service.register_delegate(Global, global_callback);
service.register_delegate(Member1, test.callback);
service.register_delegate(Member2, member_callback);
service.call(GLOBAL);
service.call(Global);
CHECK_EQUAL(GLOBAL, called_id);
CHECK_EQUAL(Global, called_id);
CHECK(global_called);
CHECK(!member1_called);
CHECK(!member2_called);
@ -171,13 +171,13 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER1>(test.callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member1>(test.callback);
service.register_delegate<Member2>(member_callback);
service.call<MEMBER1>();
service.call<Member1>();
CHECK_EQUAL(MEMBER1, called_id);
CHECK_EQUAL(Member1, called_id);
CHECK(!global_called);
CHECK(member1_called);
CHECK(!member2_called);
@ -189,13 +189,13 @@ namespace
{
Service service;
service.register_delegate(GLOBAL, global_callback);
service.register_delegate(MEMBER1, test.callback);
service.register_delegate(MEMBER2, member_callback);
service.register_delegate(Global, global_callback);
service.register_delegate(Member1, test.callback);
service.register_delegate(Member2, member_callback);
service.call(MEMBER1);
service.call(Member1);
CHECK_EQUAL(MEMBER1, called_id);
CHECK_EQUAL(Member1, called_id);
CHECK(!global_called);
CHECK(member1_called);
CHECK(!member2_called);
@ -207,13 +207,13 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER1>(test.callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member1>(test.callback);
service.register_delegate<Member2>(member_callback);
service.call<MEMBER2>();
service.call<Member2>();
CHECK_EQUAL(MEMBER2, called_id);
CHECK_EQUAL(Member2, called_id);
CHECK(!global_called);
CHECK(!member1_called);
CHECK(member2_called);
@ -225,11 +225,11 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER1>(test.callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member1>(test.callback);
service.register_delegate<Member2>(member_callback);
service.call(OUT_OF_RANGE);
service.call(Out_Of_Range);
CHECK_EQUAL(UINT_MAX, called_id);
CHECK(!global_called);
@ -243,15 +243,15 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER1>(test.callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member1>(test.callback);
service.register_delegate<Member2>(member_callback);
service.register_unhandled_delegate(unhandled_callback);
service.call(OUT_OF_RANGE);
service.call(Out_Of_Range);
CHECK_EQUAL(OUT_OF_RANGE, called_id);
CHECK_EQUAL(Out_Of_Range, called_id);
CHECK(!global_called);
CHECK(!member1_called);
CHECK(!member2_called);
@ -263,10 +263,10 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member2>(member_callback);
service.call<MEMBER1>();
service.call<Member1>();
CHECK_EQUAL(UINT_MAX, called_id);
CHECK(!global_called);
@ -280,10 +280,10 @@ namespace
{
Service service;
service.register_delegate(GLOBAL, global_callback);
service.register_delegate(MEMBER2, member_callback);
service.register_delegate(Global, global_callback);
service.register_delegate(Member2, member_callback);
service.call(MEMBER1);
service.call(Member1);
CHECK_EQUAL(UINT_MAX, called_id);
CHECK(!global_called);
@ -297,14 +297,14 @@ namespace
{
Service service;
service.register_delegate<GLOBAL>(global_callback);
service.register_delegate<MEMBER2>(member_callback);
service.register_delegate<Global>(global_callback);
service.register_delegate<Member2>(member_callback);
service.register_unhandled_delegate(unhandled_callback);
service.call<MEMBER1>();
service.call<Member1>();
CHECK_EQUAL(MEMBER1, called_id);
CHECK_EQUAL(Member1, called_id);
CHECK(!global_called);
CHECK(!member1_called);
CHECK(!member2_called);
@ -316,14 +316,14 @@ namespace
{
Service service;
service.register_delegate(GLOBAL, global_callback);
service.register_delegate(MEMBER2, member_callback);
service.register_delegate(Global, global_callback);
service.register_delegate(Member2, member_callback);
service.register_unhandled_delegate(unhandled_callback);
service.call(MEMBER1);
service.call(Member1);
CHECK_EQUAL(MEMBER1, called_id);
CHECK_EQUAL(Member1, called_id);
CHECK(!global_called);
CHECK(!member1_called);
CHECK(!member2_called);

View File

@ -0,0 +1,161 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2019 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "unit_test_framework.h"
#include "etl/delegate.h"
#include "etl/delegate_service.h"
namespace
{
const size_t Size = 2U;
const size_t Offset = 5U;
using Service = etl::delegate_service<Size, Offset>;
//*****************************************************************************
bool global_called = false;
bool member_called = false;
bool unhandled_called = false;
size_t called_id = UINT_MAX;
//*****************************************************************************
// The global function taking no parameters.
//*****************************************************************************
void global(size_t id)
{
global_called = true;
called_id = id;
}
//*****************************************************************************
// The external unhandled callback.
//*****************************************************************************
void unhandled(size_t id)
{
unhandled_called = true;
called_id = id;
}
//*****************************************************************************
// The test class with member functions.
//*****************************************************************************
class Test
{
public:
Test()
{
}
void member(size_t id)
{
member_called = true;
called_id = id;
}
};
Test test;
// Callback for 'member'.
constexpr etl::delegate<void(size_t)> member_callback = etl::delegate<void(size_t)>::create<Test, test, &Test::member>();
// Callback for 'global'.
constexpr etl::delegate<void(size_t)> global_callback = etl::delegate<void(size_t)>::create<global>();
// Callback for 'unhandled'.
constexpr etl::delegate<void(size_t)> unhandled_callback = etl::delegate<void(size_t)>::create<unhandled>();
constexpr etl::delegate<void(size_t)> delegate_list[]
{
global_callback,
member_callback,
unhandled_callback
};
//*****************************************************************************
// Initialises the test results.
//*****************************************************************************
struct SetupFixture
{
SetupFixture()
{
called_id = UINT_MAX;
global_called = false;
member_called = false;
unhandled_called = false;
}
};
}
namespace
{
enum
{
Global = Offset,
Member,
Out_Of_Range
};
SUITE(test_delegate_service)
{
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_delegate_compile_time_constexpr)
{
etl::delegate_service<Size, Offset, delegate_list> service;
service.call<Global>();
CHECK_EQUAL(Global, called_id);
CHECK(global_called);
CHECK(!member_called);
CHECK(!unhandled_called);
called_id = UINT_MAX;
global_called = false;
member_called = false;
unhandled_called = false;
service.call<Member>();
CHECK_EQUAL(Member, called_id);
CHECK(!global_called);
CHECK(member_called);
CHECK(!unhandled_called);
called_id = UINT_MAX;
global_called = false;
member_called = false;
unhandled_called = false;
service.call(Out_Of_Range);
CHECK_EQUAL(Out_Of_Range, called_id);
CHECK(!global_called);
CHECK(!member_called);
CHECK(unhandled_called);
}
};
}

View File

@ -68,9 +68,7 @@ namespace
using MemCast = etl::mem_cast<Size, Alignment>;
using MemCastTypes = etl::mem_cast_types<char, double, Data>;
char c;
double d;
Data data;
Data data;
SUITE(test_mem_cast)
{

View File

@ -65,8 +65,6 @@ namespace
// Test variant types.
using MemCast = etl::mem_cast_ptr;
char c;
double d;
Data data;
char* Ptr(int i)
@ -83,8 +81,6 @@ namespace
{
MemCast memCast;
char* p = nullptr;
memCast.data(Ptr(1));
CHECK_EQUAL(1U , memCast.alignment());

88
test/test_mem_type.cpp Normal file
View File

@ -0,0 +1,88 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "unit_test_framework.h"
#include "etl/experimental/mem_type.h"
#include "etl/largest.h"
#include <array>
#include <vector>
#include <algorithm>
#include <string>
namespace
{
struct Data
{
char c;
short s;
std::array<int, 10> a;
};
// Test variant types.
using MemType = etl::mem_type<etl::largest<char, double, Data>::size,
etl::largest<char, double, Data>::alignment>;
SUITE(test_mem_type)
{
TEST(test_alignment)
{
MemType memType;
CHECK(alignof(char) <= MemType::Alignment);
CHECK(alignof(short) <= MemType::Alignment);
CHECK(alignof(Data) <= MemType::Alignment);
CHECK(alignof(char) <= memType.Alignment);
CHECK(alignof(short) <= memType.Alignment);
CHECK(alignof(Data) <= memType.Alignment);
CHECK(alignof(char) <= memType.alignment());
CHECK(alignof(short) <= memType.alignment());
CHECK(alignof(Data) <= memType.alignment());
}
TEST(test_size)
{
MemType memType;
CHECK(sizeof(char) <= MemType::Size);
CHECK(sizeof(short) <= MemType::Size);
CHECK(sizeof(Data) <= MemType::Size);
CHECK(sizeof(char) <= memType.Size);
CHECK(sizeof(short) <= memType.Size);
CHECK(sizeof(Data) <= memType.Size);
CHECK(sizeof(char) <= memType.size());
CHECK(sizeof(short) <= memType.size());
CHECK(sizeof(Data) <= memType.size());
}
};
}

164
test/test_overload.cpp Normal file
View File

@ -0,0 +1,164 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2015 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "unit_test_framework.h"
#include "etl/overload.h"
#include <iostream>
namespace
{
struct Result
{
Result()
: bi(false)
, bd(false)
, bs(false)
{
}
void clear()
{
bi = false;
bd = false;
bs = false;
}
bool bi;
bool bd;
bool bs;
};
Result result;
struct Visitor
{
void operator ()(int i) { result.bi = true; }
void operator ()(double d) { result.bd = true; }
void operator ()(const std::string& s) { result.bs = true; }
};
template <typename T, typename TOverload>
void Function(T value, TOverload&& ol)
{
ol(value);
}
SUITE(test_overload)
{
//*************************************************************************
TEST(test_overload_lambdas)
{
auto overload = etl::make_overload([](int i) { result.bi = true; },
[](double d) { result.bd = true; },
[](const std::string& s) { result.bs = true; });
result.clear();
Function(int(1), overload);
CHECK(result.bi == true);
CHECK(result.bd == false);
CHECK(result.bs == false);
result.clear();
Function(double(2.0), overload);
CHECK(result.bi == false);
CHECK(result.bd == true);
CHECK(result.bs == false);
result.clear();
Function(std::string("3"), overload);
CHECK(result.bi == false);
CHECK(result.bd == false);
CHECK(result.bs == true);
}
//*************************************************************************
TEST(test_overload_lambdas_cpp17)
{
#if !defined(ETL_OVERLOAD_FORCE_CPP14)
result.clear();
Function(int(1), etl::overload
{
[](int i) { result.bi = true; },
[](double d) { result.bd = true; },
[](const std::string& s) { result.bs = true; }
});
CHECK(result.bi == true);
CHECK(result.bd == false);
CHECK(result.bs == false);
result.clear();
Function(double(2.0), etl::overload
{
[](int i) { result.bi = true; },
[](double d) { result.bd = true; },
[](const std::string& s) { result.bs = true; }
});
CHECK(result.bi == false);
CHECK(result.bd == true);
CHECK(result.bs == false);
result.clear();
Function(std::string("3"), etl::overload
{
[](int i) { result.bi = true; },
[](double d) { result.bd = true; },
[](const std::string& s) { result.bs = true; }
});
CHECK(result.bi == false);
CHECK(result.bd == false);
CHECK(result.bs == true);
#endif
}
//*************************************************************************
TEST(test_visitor_overload)
{
auto overload = etl::make_overload(Visitor());
result.clear();
Function(int(1), overload);
CHECK(result.bi == true);
CHECK(result.bd == false);
CHECK(result.bs == false);
result.clear();
Function(double(2.0), overload);
CHECK(result.bi == false);
CHECK(result.bd == true);
CHECK(result.bs == false);
result.clear();
Function(std::string("3"), overload);
CHECK(result.bi == false);
CHECK(result.bd == false);
CHECK(result.bs == true);
}
};
}

View File

@ -30,8 +30,6 @@ SOFTWARE.
#include "etl/parameter_pack.h"
#include <type_traits>
namespace
{
using Pack = etl::parameter_pack<char, short, int>;
@ -47,6 +45,13 @@ namespace
// Static assert
//CHECK_EQUAL(0U, Pack::index_of_type_v<long>);
CHECK_EQUAL(0U, (etl::parameter_pack_v<char, char, short, int>));
CHECK_EQUAL(1U, (etl::parameter_pack_v<short, char, short, int>));
CHECK_EQUAL(2U, (etl::parameter_pack_v<int, char, short, int>));
// Static assert
//CHECK_EQUAL(0U, (etl::parameter_pack_v<long, char, short, int>));
}
//*************************************************************************
@ -58,6 +63,13 @@ namespace
// Static assert
//CHECK((std::is_same_v<long, typename Pack::type_from_index_t<3U>>));
CHECK((std::is_same_v<char, etl::parameter_pack_t<0U, char, short, int>>));
CHECK((std::is_same_v<short, etl::parameter_pack_t<1U, char, short, int>>));
CHECK((std::is_same_v<int, etl::parameter_pack_t<2U, char, short, int>>));
// Static assert
//CHECK((std::is_same_v<long, etl::parameter_pack_t<3U, char, short, int>>));
}
};
}

View File

@ -448,6 +448,27 @@ namespace
int* i = pool.allocate();
pool.release(i);
}
//*************************************************************************
TEST(test_issue_406_pool_of_c_array)
{
using elem_type = uint8_t[10];
etl::pool<elem_type, 3> memPool{};
CHECK_EQUAL(3, memPool.available());
CHECK_EQUAL(0, memPool.size());
elem_type* memory = memPool.allocate();
CHECK_EQUAL(2, memPool.available());
CHECK_EQUAL(1, memPool.size());
memPool.release(memory);
CHECK_EQUAL(3, memPool.available());
CHECK_EQUAL(0, memPool.size());
}
}

View File

@ -56,6 +56,113 @@ namespace
{
};
//*********************************************
struct Copyable
{
Copyable() {}
Copyable(const Copyable& other) noexcept {}
Copyable& operator =(const Copyable& rhs) noexcept { return *this; }
Copyable(Copyable&& other) = delete;
Copyable& operator =(Copyable& rhs) = delete;
};
//*********************************************
struct Moveable
{
Moveable() {}
Moveable(Moveable&& other) noexcept { }
Moveable& operator =(Moveable&& rhs) noexcept { return *this; }
Moveable(const Moveable& other) = delete;
Moveable& operator =(const Moveable& rhs) = delete;
};
//*********************************************
struct MoveableCopyable
{
MoveableCopyable() {}
MoveableCopyable(MoveableCopyable&& other) noexcept {}
MoveableCopyable& operator =(MoveableCopyable&& rhs) noexcept { return *this; }
MoveableCopyable(const MoveableCopyable& other) {}
MoveableCopyable& operator =(const MoveableCopyable& rhs) { return *this; }
};
}
// Definitions for when the STL and compiler built-ins are not avalable.
#if ETL_NOT_USING_STL && !defined(ETL_USE_TYPE_TRAITS_BUILTINS)
using etl::is_assignable;
using etl::is_constructible;
using etl::is_copy_constructible;
using etl::is_move_constructible;
//*************************
template <>
struct etl::is_assignable<Copyable, Copyable> : public etl::true_type
{
};
template <>
struct etl::is_constructible<Copyable> : public etl::true_type
{
};
template <>
struct etl::is_copy_constructible<Copyable> : public etl::true_type
{
};
template <>
struct etl::is_move_constructible<Copyable> : public etl::false_type
{
};
//*************************
template <>
struct etl::is_assignable<Moveable, Moveable> : public etl::true_type
{
};
template <>
struct etl::is_constructible<Moveable> : public etl::true_type
{
};
template <>
struct etl::is_copy_constructible<Moveable> : public etl::false_type
{
};
template <>
struct etl::is_move_constructible<Moveable> : public etl::true_type
{
};
//*************************
template <>
struct etl::is_assignable<MoveableCopyable, MoveableCopyable> : public etl::true_type
{
};
template <>
struct etl::is_constructible<MoveableCopyable> : public etl::true_type
{
};
template <>
struct etl::is_copy_constructible<MoveableCopyable> : public etl::true_type
{
};
template <>
struct etl::is_move_constructible<MoveableCopyable> : public etl::true_type
{
};
#endif
namespace
{
SUITE(test_type_traits)
{
//*************************************************************************
@ -871,4 +978,110 @@ namespace
CHECK((etl::are_all_same<int, int, int, int, int>::value == true));
CHECK((etl::are_all_same<int, int, int, char, int>::value == false));
}
//*************************************************************************
TEST(test_conjunction)
{
CHECK((etl::conjunction_v<etl::true_type, etl::true_type, etl::true_type>));
CHECK((!etl::conjunction_v<etl::true_type, etl::false_type, etl::true_type>));
}
//*************************************************************************
TEST(test_disjunction)
{
CHECK((etl::disjunction_v<etl::false_type, etl::true_type, etl::false_type>));
CHECK((!etl::disjunction_v<etl::false_type, etl::false_type, etl::false_type>));
}
//*************************************************************************
TEST(test_is_assignable)
{
CHECK((etl::is_assignable_v<Copyable, Copyable>) == (std::is_assignable_v<Copyable, Copyable>));
CHECK((etl::is_assignable_v<Moveable, Moveable>) == (std::is_assignable_v<Moveable, Moveable>));
CHECK((etl::is_assignable_v<MoveableCopyable, MoveableCopyable>) == (std::is_assignable_v<MoveableCopyable, MoveableCopyable>));
}
//*************************************************************************
TEST(test_is_lvalue_assignable)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_lvalue_assignable_v<Copyable, Copyable>));
CHECK(!(etl::is_lvalue_assignable_v<Moveable, Moveable>));
CHECK((etl::is_lvalue_assignable_v<MoveableCopyable, MoveableCopyable>));
#endif
}
//*************************************************************************
TEST(test_is_constructible)
{
CHECK((etl::is_constructible_v<Copyable>) == (std::is_constructible_v<Copyable>));
CHECK((etl::is_constructible_v<Moveable>) == (std::is_constructible_v<Moveable>));
CHECK((etl::is_constructible_v<MoveableCopyable>) == (std::is_constructible_v<MoveableCopyable>));
}
//*************************************************************************
TEST(test_is_copy_constructible)
{
CHECK((etl::is_copy_constructible_v<Copyable>) == (std::is_copy_constructible_v<Copyable>));
CHECK((etl::is_copy_constructible_v<Moveable>) == (std::is_copy_constructible_v<Moveable>));
CHECK((etl::is_copy_constructible_v<MoveableCopyable>) == (std::is_copy_constructible_v<MoveableCopyable>));
}
//*************************************************************************
TEST(test_is_move_constructible)
{
CHECK((etl::is_move_constructible_v<Copyable>) == (std::is_move_constructible_v<Copyable>));
CHECK((etl::is_move_constructible_v<Moveable>) == (std::is_move_constructible_v<Moveable>));
CHECK((etl::is_move_constructible_v<MoveableCopyable>) == (std::is_move_constructible_v<MoveableCopyable>));
}
//*************************************************************************
TEST(test_is_trivially_constructible)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_trivially_constructible_v<Copyable>) == (std::is_trivially_constructible_v<Copyable>));
CHECK((etl::is_trivially_constructible_v<Moveable>) == (std::is_trivially_constructible_v<Moveable>));
CHECK((etl::is_trivially_constructible_v<MoveableCopyable>) == (std::is_trivially_constructible_v<MoveableCopyable>));
#endif
}
//*************************************************************************
TEST(test_is_trivially_copy_constructible)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_trivially_copy_constructible_v<Copyable>) == (std::is_trivially_copy_constructible_v<Copyable>));
CHECK((etl::is_trivially_copy_constructible_v<Moveable>) == (std::is_trivially_copy_constructible_v<Moveable>));
CHECK((etl::is_trivially_copy_constructible_v<MoveableCopyable>) == (std::is_trivially_copy_constructible_v<MoveableCopyable>));
#endif
}
//*************************************************************************
TEST(test_is_trivially_destructible)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_trivially_destructible_v<Copyable>) == (std::is_trivially_destructible_v<Copyable>));
CHECK((etl::is_trivially_destructible_v<Moveable>) == (std::is_trivially_destructible_v<Moveable>));
CHECK((etl::is_trivially_destructible_v<MoveableCopyable>) == (std::is_trivially_destructible_v<MoveableCopyable>));
#endif
}
//*************************************************************************
TEST(test_is_trivially_copy_assignable)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_trivially_copy_assignable_v<Copyable>) == (std::is_trivially_copy_assignable_v<Copyable>));
CHECK((etl::is_trivially_copy_assignable_v<Moveable>) == (std::is_trivially_copy_assignable_v<Moveable>));
CHECK((etl::is_trivially_copy_assignable_v<MoveableCopyable>) == (std::is_trivially_copy_assignable_v<MoveableCopyable>));
#endif
}
//*************************************************************************
TEST(test_is_trivially_copyable)
{
#if ETL_USING_STL || defined(ETL_USE_TYPE_TRAITS_BUILTINS) || defined(ETL_USER_DEFINED_TYPE_TRAITS)
CHECK((etl::is_trivially_copyable_v<Copyable>) == (std::is_trivially_copyable_v<Copyable>));
CHECK((etl::is_trivially_copyable_v<Moveable>) == (std::is_trivially_copyable_v<Moveable>));
CHECK((etl::is_trivially_copyable_v<MoveableCopyable>) == (std::is_trivially_copyable_v<MoveableCopyable>));
#endif
}
}

View File

@ -28,7 +28,7 @@ SOFTWARE.
#include "unit_test_framework.h"
#include "etl/variant.h"
#include "etl/private/variant_legacy.h"
#include <array>
#include <vector>

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,8 @@ Global
Debug LLVM - No STL|x64 = Debug LLVM - No STL|x64
Debug LLVM|Win32 = Debug LLVM|Win32
Debug LLVM|x64 = Debug LLVM|x64
Debug MSVC - No STL - Builtins|Win32 = Debug MSVC - No STL - Builtins|Win32
Debug MSVC - No STL - Builtins|x64 = Debug MSVC - No STL - Builtins|x64
Debug MSVC - No STL - Force No Advanced|Win32 = Debug MSVC - No STL - Force No Advanced|Win32
Debug MSVC - No STL - Force No Advanced|x64 = Debug MSVC - No STL - Force No Advanced|x64
Debug MSVC - No STL|Win32 = Debug MSVC - No STL|Win32
@ -27,6 +29,8 @@ Global
Debug MSVC No Checks|x64 = Debug MSVC No Checks|x64
Debug MSVC|Win32 = Debug MSVC|Win32
Debug MSVC|x64 = Debug MSVC|x64
Debug LLVM - No STL - Builtins|Win32 = Debug LLVM - No STL - Builtins|Win32
Debug LLVM - No STL - Builtins|x64 = Debug LLVM - No STL - Builtins|x64
LLVM New|Win32 = LLVM New|Win32
LLVM New|x64 = LLVM New|x64
MSVCDebugAppveyor|Win32 = MSVCDebugAppveyor|Win32
@ -45,6 +49,10 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|Win32.Build.0 = Debug LLVM|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|x64.ActiveCfg = Debug LLVM|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|x64.Build.0 = Debug LLVM|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Builtins|Win32.ActiveCfg = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Builtins|Win32.Build.0 = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Builtins|x64.ActiveCfg = Debug-MSVC-No-STL-Builtins|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Builtins|x64.Build.0 = Debug-MSVC-No-STL-Builtins|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Force No Advanced|Win32.ActiveCfg = DebugNoSTLForceNoAdvanced|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Force No Advanced|Win32.Build.0 = DebugNoSTLForceNoAdvanced|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No STL - Force No Advanced|x64.ActiveCfg = DebugNoSTLForceNoAdvanced|x64
@ -60,7 +68,7 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|Win32.ActiveCfg = DebugMSVCSmallStrings|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|Win32.Build.0 = DebugMSVCSmallStrings|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|x64.ActiveCfg = DebugMSVCSmallStrings|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|x64.Build.0 = DebugMSVCSmall Strings|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|x64.Build.0 = DebugMSVCSmallStrings|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|Win32.ActiveCfg = DebugStringTruncationIsError|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|Win32.Build.0 = DebugStringTruncationIsError|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|x64.ActiveCfg = DebugStringTruncationIsError|x64
@ -77,6 +85,10 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC|Win32.Build.0 = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC|x64.ActiveCfg = Debug|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC|x64.Build.0 = Debug|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM - No STL - Builtins|Win32.ActiveCfg = Debug-LLVM-NoSTL-Builtins|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM - No STL - Builtins|Win32.Build.0 = Debug-LLVM-NoSTL-Builtins|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM - No STL - Builtins|x64.ActiveCfg = Debug-LLVM-NoSTL-Builtins|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM - No STL - Builtins|x64.Build.0 = Debug-LLVM-NoSTL-Builtins|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.LLVM New|Win32.ActiveCfg = LLVM New|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.LLVM New|Win32.Build.0 = LLVM New|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.LLVM New|x64.ActiveCfg = LLVM New|x64

File diff suppressed because it is too large Load Diff

View File

@ -118,6 +118,9 @@
<Filter Include="ETL\Arduino\Examples\Vector_Examples\Example_Vector_1_simple_use">
<UniqueIdentifier>{0e4d2126-b9b7-4eef-b5ca-18363b1e01ce}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Sanity Checks\Logs">
<UniqueIdentifier>{5b76fd56-eb83-489f-b9a6-798c07c5fa76}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\etl\enum_type.h">
@ -1113,12 +1116,33 @@
<ClInclude Include="..\..\include\etl\hfsm.h">
<Filter>ETL\Frameworks</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\private\variant_legacy.h">
<Filter>ETL\Private</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\private\variant_variadic.h">
<Filter>ETL\Private</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\mem_cast.h">
<Filter>ETL\Utilities</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\bip_buffer_spsc_atomic.h">
<Filter>ETL\Containers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\private\variant_legacy.h">
<Filter>ETL\Private</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\private\variant_new.h">
<Filter>ETL\Private</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\overload.h">
<Filter>ETL\Patterns</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\overload.h">
<Filter>ETL\Patterns</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\experimental\mem_cast.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\main.cpp">
@ -1172,7 +1196,7 @@
<ClCompile Include="..\test_bitset.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_variant.cpp">
<ClCompile Include="..\test_variant_legacy.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_smallest.cpp">
@ -1673,6 +1697,210 @@
<ClCompile Include="..\test_message_router_registry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_ccitt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_cdma2000.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_darc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_dvbs2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_ebu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_icode.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_itu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_maxim.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_rohc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc8_wcdma.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_ccitt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_kermit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_modbus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_usb.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_xmodem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_aug_ccitt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_genibus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_x25.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_buypass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_profibus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_c.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_bzip2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_posix.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_mpeg2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc64_ecma.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_cdma2000.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_dds110.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_dectr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_dectx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_dnp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_en13757.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_mcrf4xx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_riello.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_t10dif.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_maxim.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_teledisk.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_tms37157.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_a.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_d.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_q.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_jamcrc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc32_xfer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_crc16_arc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_histogram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_correlation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_covariance.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_standard_deviation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_variance.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_threshold.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_invert.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_limiter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_quantize.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_gamma.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_rescale.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_rms.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_mean.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_atomic_gcc_sync.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_hfsm.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_variant_variadic.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast_ptr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_variant_new.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast_ptr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_overload.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test_delegate_service_compile_time.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\absolute.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1751,30 +1979,108 @@
<ClCompile Include="..\sanity-check\container.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\correlation.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\covariance.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_ccitt.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_cdma2000.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_darc.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_dvbs2.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_ebu.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_icode.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_itu.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_maxim.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_rohc.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_wcdma.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_a.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_arc.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_aug_ccitt.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_buypass.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_ccitt.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_cdma2000.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dds110.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectr.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectx.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dnp.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_en13757.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_genibus.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_kermit.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_maxim.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_mcrf4xx.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_modbus.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_profibus.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_riello.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_t10dif.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_teledisk.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_tms37157.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_usb.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1793,12 +2099,24 @@
<ClCompile Include="..\sanity-check\crc32_c.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_d.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_jamcrc.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_mpeg2.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_posix.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_q.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_xfer.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc64_ecma.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1886,12 +2204,18 @@
<ClCompile Include="..\sanity-check\functional.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\gamma.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\generic_pool.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\hash.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\histogram.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\ihash.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1922,6 +2246,9 @@
<ClCompile Include="..\sanity-check\intrusive_stack.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\invert.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\io_port.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1940,6 +2267,9 @@
<ClCompile Include="..\sanity-check\largest.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\limiter.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\limits.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -1958,6 +2288,12 @@
<ClCompile Include="..\sanity-check\math_constants.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\mean.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\mem_cast.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\memory.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2021,6 +2357,9 @@
<ClCompile Include="..\sanity-check\optional.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\overload.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\packet.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2051,6 +2390,9 @@
<ClCompile Include="..\sanity-check\priority_queue.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\quantize.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\queue.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2099,6 +2441,12 @@
<ClCompile Include="..\sanity-check\reference_flat_set.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\rescale.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\rms.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\scaled_rounding.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2123,6 +2471,9 @@
<ClCompile Include="..\sanity-check\stack.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\standard_deviation.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\state_chart.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2147,6 +2498,9 @@
<ClCompile Include="..\sanity-check\task.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\threshold.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\timer.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
@ -2504,49 +2858,40 @@
<ClCompile Include="..\sanity-check\gamma.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\histogram.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\invert.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\limiter.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\mean.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\quantize.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\rescale.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\rms.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\standard_deviation.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\threshold.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\variance.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_atomic_gcc_sync.cpp">
<Filter>Source Files</Filter>
<ClCompile Include="..\sanity-check\variant.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_hfsm.cpp">
<Filter>Source Files</Filter>
<ClCompile Include="..\sanity-check\variant_legacy.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast.cpp">
<Filter>Source Files</Filter>
<ClCompile Include="..\sanity-check\variant_variadic.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_mem_cast_ptr.cpp">
<Filter>Source Files</Filter>
<ClCompile Include="..\sanity-check\variant_old.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\mem_cast.h.t.cpp">
<ClCompile Include="..\sanity-check\variant_pool.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\vector.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\version.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\visitor.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\wformat_spec.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\wstring.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\wstring_stream.h.t.cpp">
<Filter>Source Files\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\bip_buffer_spsc_atomic.h.t.cpp">
@ -2668,7 +3013,7 @@
<Filter>Source Files\Sanity Checks\C++17</Filter>
</Text>
<Text Include="..\sanity-check\log.txt">
<Filter>Source Files\Sanity Checks</Filter>
<Filter>Source Files\Sanity Checks\Logs</Filter>
</Text>
</ItemGroup>
<ItemGroup>
@ -2696,4 +3041,4 @@
<Filter>Resource Files</Filter>
</Natvis>
</ItemGroup>
</Project>
</Project>