1

The following nested typedef works:

struct FOOO
{

    struct TRAITS
    {
        using size_type = std::uint32_t;
    };
    void func(TRAITS::size_type arg) { } // This works fine if FOOO is not a template class.
};

However, if I make FOOO a template class, it doesn't work:

template <typename T>
struct FOOO
{

    struct TRAITS
    {
        using size_type = std::uint32_t;
    };
    void func(TRAITS::size_type arg) { } // This works fine if FOOO is not a template class.
};

    //syntax error: identifier 'size_type'

I'm wondering why this is, I can't make sense of it. I am on Visual Studio 2019.

Zebrafish
  • 11,682
  • 3
  • 43
  • 119

0 Answers0