Compiling with Clang shows an error:
main.cpp:4:8: error: declaration of 'Container' shadows template parameter
struct Container
if you rename the structure or template patternmeter, the code also compiles in g ++, I donβt know if the same name from them was random or intentional.
In addition, g ++ 4.8.2 and 4.9 work fine and give a similar error like Clang.
source
share