How to add a property to a class : <p>I'm working on a new application, based on templates, STL, namespaces, ... (my collegues have taken all necessary steps to make a mess), now I just want to add a property to a class, and this does not work, let me show you):</p>

<p>Within a header-file:</p>

<pre><code>namespace utils{

class Logging_Manager : public Singleton&lt;Logging_Manager&gt; {
    friend Singleton&lt;Logging_Manager&gt;;

    Logging_Manager();

private:
    std::vector&lt;std::shared_ptr&lt;Single_Logger&gt;&gt; logging_modules;
    LogLevelType loglevel; // 0 : no logging, 1 : info logging, (2-4 are not used), 5 : debug, 6 : everything
public:
    Timer getDebuggerTimer;
    Timer getFileTimer;
</code></pre>

<p>I've just added the last entries <code>getDebuggerTimer</code> and <code>getFileTimer</code> myself and this does not compile, due to the compiler errors C3646 and C4430.</p>

<p>All I mean is that both are properties of the type <code>Timer</code>, I don't mean those things to be templates of some methods which might be abstract, virtual, or whatsoever, no they are just to meant as properties, nothing more nothing less.</p>

<p>As I didn't find a way to add both timers to my header file, my boss has just solved the issue as follows:</p>

<pre><code>class Timer;    // this class is defined elsewhere, how can it be put here and make things work?
namespace utils{

class Logging_Manager : public Singleton&lt;Logging_Manager&gt; {
    friend Singleton&lt;Logging_Manager&gt;;

    Logging_Manager();

private:
    std::shared_ptr&lt;Timer&gt; getDebuggerTimer;
    std::shared_ptr&lt;Timer&gt; getFileTimer;
</code></pre>

<p>In other words: he did not add an inclusion, but he added a reference to something the header does not know: <code>class Timer</code>.</p>

<p>In top of this, he added a shared pointer, which magically did something.</p>

<p>I'm completely lost here: it looks like STL has added programming rules like:<br/>
- In case you want something to work, don't add an inclusion, but add a reference (but how does your code know what the reference means?)
- You can add shared pointers (or other STL inventions), who will make your code work.</p>

<p>?????</p>

<p>Can anybody shed a light to this?</p>
