Skip to content
Discussion options

You must be logged in to vote

I'm not sure whether the above is supposed to work or if it's a bug.
However, either of the following works:

  nb::detail::tuple<int, int> tpl = {3, 17};

  std::cout << tpl.get<0>() << "\n";
  std::cout << tpl.get<1>() << "\n";

  const auto& [aa, bb] = tpl;
  std::cout << aa << "\n";
  std::cout << bb << "\n";

@wjakob, how would you feel about a PR that adds support for std::get?

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
7 replies
@hubernikus
Comment options

@hpkfft
Comment options

Answer selected by hubernikus
@hpkfft
Comment options

@hubernikus
Comment options

@hpkfft
Comment options

@hubernikus
Comment options

Comment options

You must be logged in to vote
2 replies
@hubernikus
Comment options

@shubhamjaju03
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants