2#ifndef included_AMP_to_tuple
3#define included_AMP_to_tuple
5#include "AMP/utils/MacroFunctions.h"
18 constexpr operator T();
20template<
class T,
typename... Args>
21decltype( void( T{ std::declval<Args>()... } ), std::true_type() )
test(
int );
22template<
class T,
typename... Args>
23std::false_type
test( ... );
24template<
class T,
typename... Args>
27template<
class T,
typename... Args>
32#define AMP_PRINT( X ) _##X
34#define AMP_ANY( X ) any_type
35#define AMP_TO_TUPLE_BLOCK2( N ) \
36 if constexpr ( is_braces_constructible_v<type, AMP_SEQ_U( N, AMP_ANY, AMP_COMMA )> ) { \
37 auto &&[AMP_SEQ_U( N, AMP_PRINT, AMP_COMMA )] = object; \
38 return std::make_tuple( AMP_SEQ_U( N, AMP_PRINT, AMP_COMMA ) ); \
40#define AMP_TO_TUPLE_BLOCK( N ) AMP_SEQ_D( N, AMP_TO_TUPLE_BLOCK2, AMP_NULL )
49#ifndef DISABLE_TO_TUPLE
50 using type = std::decay_t<T>;
53 AMP_ERROR(
"to_tuple is not supported by compiler" )
#define AMP_ERROR(MSG)
Throw error.
constexpr bool is_braces_constructible_v
decltype(void(T{ std::declval< Args >()... }), std::true_type()) test(int)
auto to_tuple(T &&object) noexcept
#define AMP_TO_TUPLE_BLOCK(N)