Local classes cannot be used in templates (this worked fine in MSVC but broke compilation in GCC, so we moved out the demo classes from the main(..) block of demo_sharedptr.cpp and the demo runs fine anyway).