“elaborated type refers to typedef” error when trying to befriend a typedef

后端 未结 3 1558
醉梦人生
醉梦人生 2021-01-12 09:43

Let\'s say I have the following piece of code (a simple CRTP class hierarchy). I want to typedef the base class type to save myself typing (in my actual code, I use the base

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 09:48

    I believe that this is not possible with C++03, but was added to C++11 in which you can simply omit the class keyword:

    friend BaseType;
    

提交回复
热议问题