Pure virtual function which must set variable <p>recently i have read some about pure virtual function concept in c++ and i wonder, given following code:</p> <pre><code>class First { public: virtual void init() = 0; protected: bool initialized; }; class Second : public First { public: void init() { ((*someting*) ? (initialized=true) : (initialized=false)); }; </code></pre> <p>if creator of <code>First</code> class wanted to ensure the implementation of <code>init()</code> MUST set <code>initialized</code> variable either true or false how can they do that? Is there an option to enforce implementation of pure virtual function to set any variable inherited from base class?</p>