MCPcopy Create free account
hub / github.com/fmtlib/fmt / get

Function get

include/fmt/compile.h:77–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75// Returns a reference to the argument at index N from [first, rest...].
76template <int N, typename T, typename... Args>
77constexpr auto get([[maybe_unused]] const T& first,
78 [[maybe_unused]] const Args&... rest) -> const auto& {
79 static_assert(N < 1 + sizeof...(Args), "index is out of bounds");
80 if constexpr (N == 0)
81 return first;
82 else
83 return detail::get<N - 1>(rest...);
84}
85
86# if FMT_USE_NONTYPE_TEMPLATE_ARGS
87template <int N, typename T, typename... Args, typename Char>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected