Re: fix for intel's compiler

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/fix-for-intel-s-compiler-tp9222p9225.html

On Sat, 2010-08-14 at 20:14 -0500, Kakhkhor Abdijalilov wrote:
> Somehow static non-const local variables and templates don't mix on
> ICC. I modified the original implementation to uses const static
> variable and everything worked well. The new implementation is
> attached.

Kakhkhor,
        do you also need the scoped_ptr below? Would a simple static const
map_type work?

Luigi


> //-----------------------------------------
>     template <class T>
>     class Singleton : private boost::noncopyable {
>     ...
>     private:
>         typedef std::map<Integer, boost::shared_ptr<T> > map_type;
>         static const boost::scoped_ptr<map_type> instances_;
>     };
>
>     template <typename T>
>     const boost::scoped_ptr<Singleton<T>::map_type>
>         Singleton<T>::instances_(new Singleton<T>::map_type);



--

The First Rule of Optimization: Don't do it.
The Second Rule of Optimization (For experts only): Don't do it yet.
-- Michael Jackson



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev