Commit 0250f6bb authored by Dominik Charousset's avatar Dominik Charousset

Add const overload to get

parent 8a6cbdae
......@@ -115,6 +115,9 @@ public:
/// Unique pointer to an outbound path.
using typename super::unique_path_ptr;
// Lists all tempate parameters `[T, Ts...]`;
using param_list = detail::type_list<T, Ts...>;
/// State held for each slot.
struct non_owning_ptr {
path_ptr ptr;
......@@ -140,8 +143,15 @@ public:
template <class U>
U& get() {
static constexpr size_t i =
detail::tl_index_of<detail::type_list<T, Ts...>, U>::value;
static constexpr auto i = detail::tl_index_of<param_list, U>::value;
return std::get<i>(nested_);
// TODO: replace with this line when switching to C++14
// return std::get<U>(substreams_);
}
template <class U>
const U& get() const {
static constexpr auto i = detail::tl_index_of<param_list, U>::value;
return std::get<i>(nested_);
// TODO: replace with this line when switching to C++14
// return std::get<U>(substreams_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment