Skip to content

Instantly share code, notes, and snippets.

@picanumber
Created November 23, 2016 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save picanumber/f657a096ac2aa6632fb52fc025399151 to your computer and use it in GitHub Desktop.
Save picanumber/f657a096ac2aa6632fb52fc025399151 to your computer and use it in GitHub Desktop.
template <class T>
using perfect_capture_t =
std::conditional_t<std::is_lvalue_reference<T>::value,
std::reference_wrapper<std::remove_reference_t<T>>, T>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment