c++11 - Variadic template aliases or functions? -


supposing 1 needs obtain logical value based on pack of template parameters, there reason prefer alias approach vs function approach?

example:

template<bool...> struct bool_pack; template<bool... bs>  using all_true = std::is_same<bool_pack<bs..., true>,                               bool_pack<true, bs...>>; 

as opposed to

template<class none=void> constexpr bool all_true() { return true; }  template<bool first, bool... rest> constexpr bool all_true() {   return first , all_true<rest...>(); } 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -