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
  • 5,996
  • 16
  • 49
  • 56
matthias_buehlmann
  • 4,359
  • 5
  • 30
  • 61

0 Answers0