0

let's say I have

template <int Dimension, typename T>
class Image {
    ...
    Format GetFormat() const;
}

and now I want to create template specialised implementations for GetFormat that only care about the Dimension however. like this for example:

template<>
Image<1, ???>::GetFormat() const {
    return Format::Alpha8;
}

template<>
Image<4, ???>::GetFormat() const {
    return Format::Rgba8888;
}

So in the specialized implementation I only care about the first template parameter that should be used no matter what the second parameter is.

What's the propper syntax for this?

Kara
  • 6,115
  • 16
  • 50
  • 57
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76

0 Answers0