Skip to content

Commit 6c469a7

Browse files
committed
cleanup
1 parent 239456c commit 6c469a7

6 files changed

Lines changed: 28 additions & 24 deletions

File tree

include/rsl/_impl/macro/diagnostic.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# define RSL_DIAGS_literal_suffix "-Wliteral-suffix"
4040
# define RSL_DIAGS_narrowing "-Wnarrowing"
4141
#elif RSL_COMPILER == RSL_COMPILER_CLANG
42-
# define RSL_DIAGS_literal_suffix "-Wliteral-suffix"
42+
# define RSL_DIAGS_literal_suffix "-Wuser-defined-literals"
4343
# define RSL_DIAGS_narrowing "-Wc++11-narrowing"
4444
#else
4545
# warning "Unsupported compiler"

include/rsl/meta

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ consteval bool has_parent(std::meta::info R) {
8989
return R != ^^::;
9090
}
9191

92-
9392
consteval std::meta::info get_member_by_name(std::meta::info r, std::string_view name) {
9493
for (auto member : members_of(r, std::meta::access_context::unprivileged())) {
9594
if (has_identifier(member) && identifier_of(member) == name) {

include/rsl/tuple

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ struct Subscript<T, std::index_sequence<Idx...>> : SubscriptElement<T, Idx>... {
123123
}
124124
};
125125
#endif
126-
127-
template <typename... Ts>
128-
struct type_list {};
129126
} // namespace _tuple_impl
130127

131128
template <class... Types>
@@ -137,12 +134,20 @@ class tuple
137134
private:
138135
template <typename... Us>
139136
constexpr static bool enable_utypes_ctor =
140-
!std::same_as<tuple, Us...[0]> && (std::is_constructible_v<Types, Us> && ...);
137+
not(sizeof...(Us) == 1 && (std::same_as<tuple, Us> && ...)) &&
138+
(std::is_constructible_v<Types, Us> && ...);
141139

142140
template <typename... Us>
143141
constexpr static bool enable_utypes_tuple_ctor = true; // TODO
144142

143+
#if $compiler_is(CLANG)
144+
// workaround for use as template argument
145+
template <typename... Ts>
146+
struct Storage;
147+
using storage_type = Storage<Types...>;
148+
#else
145149
struct storage_type;
150+
#endif
146151
consteval {
147152
std::size_t idx = 0;
148153
define_aggregate(^^storage_type,
@@ -153,7 +158,7 @@ private:
153158
constexpr void _impl_copy_assign(this Self& self, T const& other) {
154159
template for (constexpr auto Idx :
155160
$define_static_array(std::views::iota(0ZU, sizeof...(Types)))) {
156-
self._impl_storage.[:self._impl_accessor.members[Idx]:] = other.template get<Idx>();
161+
self._impl_storage.[:self._impl_accessor.members[Idx]:] = other.template get<Idx>();
157162
}
158163
}
159164

test/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
target_sources(rsl-util-test PRIVATE main.cpp)
22
target_include_directories(rsl-util-test PRIVATE ${CMAKE_CURRENT_LIST_DIR})
33

4-
# add_subdirectory(enum)
5-
# add_subdirectory(string_view)
6-
# add_subdirectory(span)
7-
# add_subdirectory(format)
8-
# add_subdirectory(expect)
9-
# add_subdirectory(kwargs)
10-
# add_subdirectory(tagged_variant)
11-
# add_subdirectory(variant)
12-
# add_subdirectory(tuple)
4+
add_subdirectory(enum)
5+
add_subdirectory(string_view)
6+
add_subdirectory(span)
7+
add_subdirectory(format)
8+
add_subdirectory(expect)
9+
add_subdirectory(kwargs)
10+
add_subdirectory(tagged_variant)
11+
add_subdirectory(variant)
12+
add_subdirectory(tuple)
1313

1414
add_subdirectory(serializer)
1515
# add_subdirectory(trie)

test/tagged_variant/access.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ enum UnscopedEnum { //
1818
};
1919

2020
TEST(TaggedVariant, GetTag) {
21-
using type = rsl::tagged_variant<ScopedEnum>;
22-
type variant{42};
21+
using variant_type = rsl::tagged_variant<ScopedEnum>;
22+
variant_type variant{42};
2323
ASSERT_EQ(get_tag<ScopedEnum>(variant), ScopedEnum::INT);
2424

25-
variant = type{std::in_place_index<2>, false};
25+
variant = variant_type{std::in_place_index<2>, false};
2626
ASSERT_EQ(get_tag<ScopedEnum>(variant), ScopedEnum::BOOL);
2727
}
2828

test/tagged_variant/switch.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ enum UnscopedEnum { //
2121
}
2222

2323
TEST(TaggedVariant, Switch) {
24-
using type = rsl::tagged_variant<ScopedEnum>;
25-
type variant{42};
24+
using variant_type = rsl::tagged_variant<ScopedEnum>;
25+
variant_type variant{42};
2626
switch (variant) {
27-
using enum type::tags;
27+
using enum variant_type::tags;
2828
case INT: ASSERT_EQ(get<INT>(variant), 42); break;
2929
case CHAR: FAIL();
3030
case BOOL: FAIL();
3131
}
3232

33-
variant = type{std::in_place_index<2>, false};
33+
variant = variant_type{std::in_place_index<2>, false};
3434
switch (variant) {
35-
using enum type::tags;
35+
using enum variant_type::tags;
3636
case INT: FAIL();
3737
case CHAR: FAIL();
3838
case BOOL: ASSERT_EQ(variant->BOOL, false); break;

0 commit comments

Comments
 (0)