41 std::list<int> lst{1, 2, 3, 4, 5};
100 stream <<
"The contents of c4: " << c4 <<
endl;
103template<
typename Type>
106 using type = std::remove_reference_t<Type>;
108 if constexpr(std::is_array_v<type> || std::is_function_v<type>)
112 return (std::decay_t<type>)(arg);
117 return std::forward<Type>(arg);
123 int array[]{1, 2, 3};
127 auto decayed_array =
decay(array);
134template<
typename Type>
137template<
typename Type,
typename... Types>
141 constexpr auto all_types_same
145 constexpr auto common_type_exists
148 static_assert(common_type_exists,
"Common Type Does Not Exist");
150 if constexpr(all_types_same)
153 using container_t = std::vector<element_t>;
155 return container_t{ std::forward<Type>(arg),
156 std::forward<Types>(args)...};
165 if constexpr(tpf::types::is_integral_v<common_type>)
168 constexpr auto all_unsigned
171 if constexpr(all_unsigned)
174 using container_t = std::vector<element_t>;
176 return container_t{
static_cast<element_t>(arg),
181 using element_t = std::make_signed_t<common_type>;
182 using container_t = std::vector<element_t>;
184 return container_t{
static_cast<element_t>(arg),
191 using container_t = std::vector<element_t>;
193 return container_t{
static_cast<element_t>(arg),
215template<
typename Type,
typename... Types>
219 constexpr auto all_types_same
223 constexpr auto common_type_exists
226 if constexpr(all_types_same || common_type_exists)
228 return make_vector( std::forward<Type>(arg), std::forward<Types>(args)...);
234 return std::make_tuple(std::forward<Type>(arg), std::forward<Types>(args)...);
void test_reverse_range_for()
void test_make_variants_containers()
void test_reverse_range_based_for_loop()
std::remove_cv_t< std::remove_reference_t< std::decay_t< Type > > > decay_remove_cv_ref_t
void test_make_container()
auto make_container(Type &&arg, Types &&... args)
decltype(auto) decay(Type &&arg)
auto make_vector(Type &&arg, Types &&... args)
constexpr auto make_tuple(ArgTypes &&... args) noexcept
hidden::common_type_t< Types... > common_type_t
decltype(auto) make_container(Type &&arg, Types &&... args)
decltype(auto) reverse(ContainerType &&container)
decltype(auto) make_variants(Type &&arg, Types &&... args)
Stream output operators << are implemented.
#define Tpf_GetTypeCategory(instance_arg)
A macro that returns instance_arg's type category string name.