tags:

views:

56

answers:

2

I want to create a class that is usable without being instanced, but that can also be instanced. Similar to a math class I suppose.

Thanks

+4  A: 

If you add static methods to the class, you can call them like this

 ClassName::staticMethod();

You are not stopped from also creating instances of this class.

Lou Franco
can I use . instead of ::?
Milo
@Milo: No, not in C++
AndiDog
@Milo -- If you declare an object of the class, you can call static methods with a (.)
PigBen
A: 

A regular class with a constructor with static class functions.

steinar