I am learning C++, this may be a silly question.
I want to create a class for common type definitons and using it in many cpp files by inluding. Header is "CommonTypesCls.h":
class CommonTypesCls
{
public:
typedef unsigned int UINT32;
typedef int INT32;
}
And I want to use these attributes in source.cpp like that:
#include "CommonTypesCls.h"
int main()
{
int a = sizeof(UINT32);
return 0;
}
Is it possible to using a inclueded class' member type without scope resolution?
No, it's not possible unless you use a type alias.
But you shouldn't do that because a class is not a suitable place to collect type definitions.
Put them in the global scope or in a namespace instead.