-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
A few of the tuple get operations aren't working as described, here's a unit test that will illustrate the issue:
TEST_CASE("member get indexing", "[tuple]") {
using namespace stdx::literals;
constexpr auto t = stdx::tuple{1, true};
static_assert(1 == t[stdx::index<0>]); // works
static_assert(1 == t[0_idx]); // works
static_assert(1 == t[stdx::tag<int>]); // fails
static_assert(1 == t.get(stdx::index<0>)); // fails
static_assert(1 == t.get(0_idx)); // fails
static_assert(1 == t.get(stdx::tag<int>)); // fails
}The above test was adapted from the tuple documentation:
cpp-std-extensions/docs/tuple.adoc
Line 80 in 4b0b178
| `get` is also available as a member function on `stdx::tuple` and works either |
`get` is also available as a member function on `stdx::tuple` and works either
by index or by type (using the `tag` variable template):
[source,cpp]
----
using namespace stdx::literals;
auto t = stdx::tuple{1, true};
auto x_by_index1 = t.get(index<0>);
auto x_by_index2 = t.get(0_idx);
auto x_by_type = t.get(tag<int>);
----
Metadata
Metadata
Assignees
Labels
No labels