Why are helpers defined with abstract + final
I've noticed almost all helpers in WTLHelper are defined like:
struct SomeHelper abstract final
{
static bool StaticMethod();
};
My current understanding is that this behaves just like a namespace right? I mean, we can't really instantiate (abstract) nor derive(final) from these helpers. I'm just curious why was this pattern chosen instead of a namespace? Regardless, I'm enjoying using this since I got started with WTL so thank you
"abstract final" means that no instance could be created and no class could be derived. The class just provides a bunch of static helpers. It's similar to putting them in a namespace. However, with a namespace you can use "using namespace foo" to gain access without the namespace name, which you cannot do with a class/struct. That's why I prefer it.