2

I'd like to benefit from Argument-Dependent Lookup when I extract a specific field from a tuple, but the following is illegal according to my compilers:

#include <tuple>

int main()
{
    auto t = std::make_tuple<int>(0);
    return get<0>(t);
}
clang++ --std=c++14 -O2 -Werror -Wall -Wextra -pedantic
  error: use of undeclared identifier 'get'

Why, since t has a type defined in ::std, std::get is not found after ADL?

YSC
  • 38,212
  • 9
  • 96
  • 149

0 Answers0