mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Fixed incomplete template specialisations in type_traits.h
This commit is contained in:
parent
188b4d6c60
commit
2e234c7ff5
1
.gitignore
vendored
1
.gitignore
vendored
@ -324,3 +324,4 @@ test/vs2019/Test1
|
||||
test/vs2019/Test2
|
||||
test/vs2019/Debug MSVC - Force C++03
|
||||
test/vs2019/Debug LLVM - No STL
|
||||
test/vs2019/Debug - No STL
|
||||
|
||||
@ -284,8 +284,8 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// is_signed
|
||||
template <typename T> struct is_signed : false_type {};
|
||||
template <> struct is_signed<char> : integral_constant<bool, (char(255) < 0)> {};
|
||||
template <> struct is_signed<wchar_t> : public etl::integral_constant<bool, static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
|
||||
template <> struct is_signed<char> : etl::bool_constant<(char(255) < 0)> {};
|
||||
template <> struct is_signed<wchar_t> : public etl::bool_constant<static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
|
||||
template <> struct is_signed<signed char> : true_type {};
|
||||
template <> struct is_signed<short> : true_type {};
|
||||
template <> struct is_signed<int> : true_type {};
|
||||
@ -307,9 +307,9 @@ namespace etl
|
||||
/// is_unsigned
|
||||
template <typename T> struct is_unsigned : false_type {};
|
||||
template <> struct is_unsigned<bool> : true_type {};
|
||||
template <> struct is_unsigned<char> : integral_constant<bool, (char(255) > 0)> {};
|
||||
template <> struct is_unsigned<char> : etl::bool_constant<(char(255) > 0)> {};
|
||||
template <> struct is_unsigned<unsigned char> : true_type {};
|
||||
template <> struct is_unsigned<wchar_t> : public etl::integral_constant<bool, (wchar_t(-1) > wchar_t(0))> {};
|
||||
template <> struct is_unsigned<wchar_t> : public etl::bool_constant<(wchar_t(-1) > wchar_t(0))> {};
|
||||
template <> struct is_unsigned<unsigned short> : true_type {};
|
||||
template <> struct is_unsigned<unsigned int> : true_type {};
|
||||
template <> struct is_unsigned<unsigned long> : true_type {};
|
||||
@ -360,7 +360,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_arithmetic
|
||||
template<typename T> struct is_arithmetic : integral_constant<bool, is_integral<T>::value || is_floating_point<T>::value> {};
|
||||
template<typename T> struct is_arithmetic : etl::bool_constant<is_integral<T>::value || is_floating_point<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -369,7 +369,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_fundamental
|
||||
template <typename T> struct is_fundamental : integral_constant<bool, is_arithmetic<T>::value || is_void<T>::value> {};
|
||||
template <typename T> struct is_fundamental : etl::bool_constant<is_arithmetic<T>::value || is_void<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -378,7 +378,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_compound
|
||||
template <typename T> struct is_compound : integral_constant<bool, !is_fundamental<T>::value> {};
|
||||
template <typename T> struct is_compound : etl::bool_constant<!is_fundamental<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -445,7 +445,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// is_pod
|
||||
/// Only fundamental and pointers types are recognised.
|
||||
template <typename T> struct is_pod : etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
template <typename T> struct is_pod : etl::bool_constant<etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -644,7 +644,7 @@ namespace etl
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct is_class : etl::integral_constant<bool, sizeof(private_type_traits::test<T>(0)) == 1U> {};
|
||||
struct is_class : etl::bool_constant<sizeof(private_type_traits::test<T>(0)) == 1U> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -711,12 +711,12 @@ namespace etl
|
||||
|
||||
#if defined(ETL_COMPILER_ARM5)
|
||||
template <typename TFrom, typename TTo>
|
||||
struct is_convertible : etl::integral_constant<bool, __is_convertible_to(TFrom, TTo)> {};
|
||||
struct is_convertible : etl::bool_constant<__is_convertible_to(TFrom, TTo)> {};
|
||||
#else
|
||||
template <typename TFrom, typename TTo>
|
||||
struct is_convertible : etl::integral_constant<bool, (decltype(private_type_traits::returnable<TTo>(0))::value &&
|
||||
decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
|
||||
(etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
|
||||
struct is_convertible : etl::bool_constant<(decltype(private_type_traits::returnable<TTo>(0))::value &&
|
||||
decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
|
||||
(etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1554,16 +1554,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_constructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1574,16 +1568,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1594,16 +1582,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_destructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1614,16 +1596,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1634,16 +1610,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copyable<T, false>;
|
||||
#endif
|
||||
|
||||
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
|
||||
|
||||
@ -272,8 +272,8 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// is_signed
|
||||
template <typename T> struct is_signed : false_type {};
|
||||
template <> struct is_signed<char> : integral_constant<bool, (char(255) < 0)> {};
|
||||
template <> struct is_signed<wchar_t> : public etl::integral_constant<bool, static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
|
||||
template <> struct is_signed<char> : etl::bool_constant<(char(255) < 0)> {};
|
||||
template <> struct is_signed<wchar_t> : public etl::bool_constant<static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
|
||||
template <> struct is_signed<signed char> : true_type {};
|
||||
template <> struct is_signed<short> : true_type {};
|
||||
template <> struct is_signed<int> : true_type {};
|
||||
@ -295,9 +295,9 @@ namespace etl
|
||||
/// is_unsigned
|
||||
template <typename T> struct is_unsigned : false_type {};
|
||||
template <> struct is_unsigned<bool> : true_type {};
|
||||
template <> struct is_unsigned<char> : integral_constant<bool, (char(255) > 0)> {};
|
||||
template <> struct is_unsigned<char> : etl::bool_constant<(char(255) > 0)> {};
|
||||
template <> struct is_unsigned<unsigned char> : true_type {};
|
||||
template <> struct is_unsigned<wchar_t> : public etl::integral_constant<bool, (wchar_t(-1) > wchar_t(0))> {};
|
||||
template <> struct is_unsigned<wchar_t> : public etl::bool_constant<(wchar_t(-1) > wchar_t(0))> {};
|
||||
template <> struct is_unsigned<unsigned short> : true_type {};
|
||||
template <> struct is_unsigned<unsigned int> : true_type {};
|
||||
template <> struct is_unsigned<unsigned long> : true_type {};
|
||||
@ -348,7 +348,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_arithmetic
|
||||
template<typename T> struct is_arithmetic : integral_constant<bool, is_integral<T>::value || is_floating_point<T>::value> {};
|
||||
template<typename T> struct is_arithmetic : etl::bool_constant<is_integral<T>::value || is_floating_point<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -357,7 +357,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_fundamental
|
||||
template <typename T> struct is_fundamental : integral_constant<bool, is_arithmetic<T>::value || is_void<T>::value> {};
|
||||
template <typename T> struct is_fundamental : etl::bool_constant<is_arithmetic<T>::value || is_void<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -366,7 +366,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
/// is_compound
|
||||
template <typename T> struct is_compound : integral_constant<bool, !is_fundamental<T>::value> {};
|
||||
template <typename T> struct is_compound : etl::bool_constant<!is_fundamental<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -433,7 +433,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// is_pod
|
||||
/// Only fundamental and pointers types are recognised.
|
||||
template <typename T> struct is_pod : etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
template <typename T> struct is_pod : etl::bool_constant<etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -632,7 +632,7 @@ namespace etl
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct is_class : etl::integral_constant<bool, sizeof(private_type_traits::test<T>(0)) == 1U> {};
|
||||
struct is_class : etl::bool_constant<sizeof(private_type_traits::test<T>(0)) == 1U> {};
|
||||
|
||||
#if ETL_CPP17_SUPPORTED
|
||||
template <typename T>
|
||||
@ -699,12 +699,12 @@ namespace etl
|
||||
|
||||
#if defined(ETL_COMPILER_ARM5)
|
||||
template <typename TFrom, typename TTo>
|
||||
struct is_convertible : etl::integral_constant<bool, __is_convertible_to(TFrom, TTo)> {};
|
||||
struct is_convertible : etl::bool_constant<__is_convertible_to(TFrom, TTo)> {};
|
||||
#else
|
||||
template <typename TFrom, typename TTo>
|
||||
struct is_convertible : etl::integral_constant<bool, (decltype(private_type_traits::returnable<TTo>(0))::value &&
|
||||
decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
|
||||
(etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
|
||||
struct is_convertible : etl::bool_constant<(decltype(private_type_traits::returnable<TTo>(0))::value &&
|
||||
decltype(private_type_traits::nonvoid_convertible<TFrom, TTo>(0))::value) ||
|
||||
(etl::is_void<TFrom>::value && etl::is_void<TTo>::value)> {};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1547,16 +1547,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_constructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1567,16 +1561,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1587,16 +1575,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_destructible<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1607,16 +1589,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable<T, false>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1627,16 +1603,10 @@ namespace etl
|
||||
{
|
||||
};
|
||||
#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
|
||||
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_trivially_copyable<T, false>;
|
||||
#endif
|
||||
|
||||
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
|
||||
|
||||
@ -15,12 +15,18 @@ gcc --version | grep gcc | tee -a log.txt
|
||||
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL - Force C++03" | tee -a log.txt
|
||||
@ -29,12 +35,18 @@ gcc --version | grep gcc | tee -a log.txt
|
||||
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=ON ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - No STL" | tee -a log.txt
|
||||
@ -43,12 +55,18 @@ gcc --version | grep gcc | tee -a log.txt
|
||||
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - No STL - Builtins" | tee -a log.txt
|
||||
@ -57,12 +75,18 @@ gcc --version | grep gcc | tee -a log.txt
|
||||
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
|
||||
#******************************************************************************
|
||||
# CLANG
|
||||
@ -75,12 +99,18 @@ clang --version | grep clang | tee -a log.txt
|
||||
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - STL - Force C++03" | tee -a log.txt
|
||||
@ -89,12 +119,18 @@ clang --version | grep clang | tee -a log.txt
|
||||
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=ON ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - No STL" | tee -a log.txt
|
||||
@ -103,12 +139,18 @@ clang --version | grep clang | tee -a log.txt
|
||||
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - No STL - Builtins" | tee -a log.txt
|
||||
@ -117,12 +159,18 @@ clang --version | grep clang | tee -a log.txt
|
||||
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03=OFF ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Passed"
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests | tee log.txt
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Tests Completed" | tee -a log.txt
|
||||
|
||||
@ -29,6 +29,7 @@ SOFTWARE.
|
||||
#include "unit_test_framework.h"
|
||||
|
||||
#include "etl/delegate.h"
|
||||
#include "etl/vector.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -171,6 +172,12 @@ namespace
|
||||
}
|
||||
};
|
||||
|
||||
//*******************************************
|
||||
int times_2(int a)
|
||||
{
|
||||
return a * 2;
|
||||
}
|
||||
|
||||
Test test_static;
|
||||
const Test const_test_static;
|
||||
}
|
||||
@ -877,5 +884,15 @@ namespace
|
||||
|
||||
CHECK(d1 != d2);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_issue_418)
|
||||
{
|
||||
etl::vector<etl::delegate<int(int)>, 5> vector_of_delegates;
|
||||
|
||||
vector_of_delegates.push_back(etl::delegate<int(int)>::create<times_2>());
|
||||
|
||||
CHECK_EQUAL(42, vector_of_delegates.front()(21));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user