I found a piece of code that uses the following statement:
using flags = std::ios_base::fmtflags;
flags fl = std::ios_base::dec;
This is the first time that I encountered it. How can you use a namespace as a type.
You seem to be confusing type aliasing with using declerations. Type aliasing behaves like a typedef, it defines another name for an existing type.
Your example is equivalent to the following :
typedef std::ios_base::fmtflags flags;
flags fl = std::ios_base::dec;
using can be templated.
using namespaceandusing other_stuffare different. You can read them as plain English to understand the meaning.