ThomasMcLeod
ThomasMcLeod

Reputation: 7779

C++ non-type template parameters: Is typedef of an integral type an integral type?

I know I can do function template template<int N> void f () {}.

But what about template<std::size_t N> void f() {}?

Upvotes: 0

Views: 259

Answers (1)

Paul Evans
Paul Evans

Reputation: 27577

A typedef is just an alias for the given type. So any typedef of an integral type is itself an integral type. And types don't get any more integral than std::size_t.

Upvotes: 3

Related Questions