Forward declarations

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward declarations

Bojan Nikolic

Hi,

It seems that a few recently added files to QuantLib trunk have harmless
but formally incorrect forward declarations of form (e.g., in
cpibond.hpp):

namespace QuantLib
{  
        class QuantLib::Schedule;
}

My compiler simply ignores these and issues a warning. They should be of
form:

namespace QuantLib {  
          class Schedule;
}

i.e., if you need to forward-declare a nested class you need to do

namespace A {
  namespace B{
     class C;
}
}

But in this case I think the forward declaration are unnecessary.

Best,
Bojan


--
Bojan Nikolic          ||          http://www.bnikolic.co.uk/ql

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Forward declarations

Luigi Ballabio
On Wed, 2011-02-16 at 20:01 +0000, Bojan Nikolic wrote:
> It seems that a few recently added files to QuantLib trunk have harmless
> but formally incorrect forward declarations of form

Fixed, thanks.

Luigi


--

The purpose of abstraction is not to be vague, but to create a new
semantic level in which one can be absolutely precise.
-- W.E. Dijkstra



------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev