Thanks to [this post](https://stackoverflow.com/questions/12796580/static-variable-for-each-derived-class), I'm trying to learning [Curiously recurring template pattern](https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern).

[This](http://coliru.stacked-crooked.com/a/267f9771385752d2) is the code I wrote:

```
#include <iostream>
#include <iomanip>
#include <vector>

using namespace std;

template<class EnvelopeType>
class Envelope
{
public:
    double mSingle = 1.0;

    void SetValue(double value) { mValue = value; }
    inline double GetValue() { return mValue; }

private:
    static double mValue;
};

class Volume : public Envelope<Volume>
{
};

class Pitch : public Envelope<Pitch>
{
};

template<EnvelopeType T>
double Envelope<T>::mValue;

int main()
{
    Envelope<Volume> mVolume;
    Envelope<Pitch> mPitch;

    mVolume.SetValue(0.5);
    mPitch.SetValue(1.0);
}

```

What's wrong? It says *unknown type name "`EnvelopeType`"*. Of course it doesn't know: that's the `T` type of the template.