Skip to content

Instantly share code, notes, and snippets.

@jonathan-beard
Created February 10, 2016 14:03
Show Gist options
  • Save jonathan-beard/aac265acc2ff58ee0dd1 to your computer and use it in GitHub Desktop.
Save jonathan-beard/aac265acc2ff58ee0dd1 to your computer and use it in GitHub Desktop.
/** enable if type you want to re-use mult. times **/
template < class T > using OBJENABLE = typename std::enable_if<
std::is_object< T >::value && !
std::is_fundamental< T >::value >::type;
/** re-use multiple times **/
template < class T, OBJENABLE< T >* = nullptr /** if null don't instantiate **/ >
void do_it( const T &t )
{
}
@jonathan-beard
Copy link
Author

Must be c++XX, where XX >= 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment