C++ 11 Initializer lists features not supported in VS 2010/2012

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

C++ 11 Initializer lists features not supported in VS 2010/2012

cheng li

Hi Peter,

 

As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp, initializer lists feature is used. As I tested this feature is not supported in vs 2010/2012. So for backward compatibility, should we remove it?  

 

Regards,

Cheng


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: C++ 11 Initializer lists features not supported in VS 2010/2012

Peter Caspers-4
Hi Cheng,

ups, this shouldn't be the case. Can you please send the name and line
number of the file where you spotted this (or just the vs compiler
error message you get) ?

Thanks a lot
Peter

On 18 July 2014 04:21, cheng li <[hidden email]> wrote:

> Hi Peter,
>
>
>
> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
> initializer lists feature is used. As I tested this feature is not supported
> in vs 2010/2012. So for backward compatibility, should we remove it?
>
>
>
> Regards,
>
> Cheng

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: C++ 11 Initializer lists features not supported in VS 2010/2012

Luigi Ballabio
In reply to this post by cheng li
As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct
initialization and it was in C++03 already, and even in C. (For
instance, see the initialization of AmericanOptionData values[] in
test-suite/americanoption.cpp.) In fact, g++ compiles it even with the
-std=c++03 flag. But I seem to remember that it might or might not
work depending on the compiler and types involved. Does it give you an
error in VC++10/12?

Luigi


On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:

> Hi Peter,
>
>
>
> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
> initializer lists feature is used. As I tested this feature is not supported
> in vs 2010/2012. So for backward compatibility, should we remove it?
>
>
>
> Regards,
>
> Cheng
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: C++ 11 Initializer lists features not supported in VS 2010/2012

cheng li
Hi Lugi and Peter,

I compiled it with VS2012. The error message reads as, e.g.
Error 97 error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp) D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp 225 1 QuantLib

All these errors points line 220 and 225 in gaussian1dmodel.hpp.

Regards,
Cheng

-----邮件原件-----
发件人: Luigi Ballabio [mailto:[hidden email]]
发送时间: 2014年7月18日 16:06
收件人: cheng li
抄送: Peter Caspers; QuantLib users
主题: Re: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012

As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct initialization and it was in C++03 already, and even in C. (For instance, see the initialization of AmericanOptionData values[] in
test-suite/americanoption.cpp.) In fact, g++ compiles it even with the
-std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?

Luigi


On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:

> Hi Peter,
>
>
>
> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
> initializer lists feature is used. As I tested this feature is not
> supported in vs 2010/2012. So for backward compatibility, should we remove it?
>
>
>
> Regards,
>
> Cheng
>
>
> ----------------------------------------------------------------------
> -------- Want fast and easy access to all the code in your enterprise?
> Index and search up to 200,000 lines of code with a free copy of Black
> Duck Code Sight - the same software that powers the world's largest
> code search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: C++ 11 Initializer lists features not supported in VS 2010/2012

Peter Caspers-4
would that work then (starting at line 216) ?

        boost::shared_ptr<VanillaSwap>
        underlyingSwap(const boost::shared_ptr<SwapIndex> &index,
                       const Date &expiry, const Period &tenor) const {

            CachedSwapKey k = {index,expiry,tenor};
            CacheType::iterator i = swapCache_.find(k);
            if (i == swapCache_.end()) {
                boost::shared_ptr<VanillaSwap> underlying =
                    index->clone(tenor)->underlyingSwap(expiry);
                swapCache_.insert(std::make_pair(k, underlying));
                return underlying;
            }
            return i->second;
        }

best
Peter

On 18 July 2014 11:17, cheng li <[hidden email]> wrote:

> Hi Lugi and Peter,
>
> I compiled it with VS2012. The error message reads as, e.g.
> Error   97      error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp)     D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp     225     1       QuantLib
>
> All these errors points line 220 and 225 in gaussian1dmodel.hpp.
>
> Regards,
> Cheng
>
> -----邮件原件-----
> 发件人: Luigi Ballabio [mailto:[hidden email]]
> 发送时间: 2014年7月18日 16:06
> 收件人: cheng li
> 抄送: Peter Caspers; QuantLib users
> 主题: Re: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012
>
> As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct initialization and it was in C++03 already, and even in C. (For instance, see the initialization of AmericanOptionData values[] in
> test-suite/americanoption.cpp.) In fact, g++ compiles it even with the
> -std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?
>
> Luigi
>
>
> On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:
>> Hi Peter,
>>
>>
>>
>> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
>> initializer lists feature is used. As I tested this feature is not
>> supported in vs 2010/2012. So for backward compatibility, should we remove it?
>>
>>
>>
>> Regards,
>>
>> Cheng
>>
>>
>> ----------------------------------------------------------------------
>> -------- Want fast and easy access to all the code in your enterprise?
>> Index and search up to 200,000 lines of code with a free copy of Black
>> Duck Code Sight - the same software that powers the world's largest
>> code search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: 答复: C++ 11 Initializer lists features not supported in VS 2010/2012

cheng li
Yes, on my side, it works on vs 2012. I will try vs 2010 later.

Regards,
Cheng

-----邮件原件-----
发件人: Peter Caspers [mailto:[hidden email]]
发送时间: 2014年7月18日 20:24
收件人: cheng li
抄送: Luigi Ballabio; QuantLib users
主题: Re: 答复: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012

would that work then (starting at line 216) ?

        boost::shared_ptr<VanillaSwap>
        underlyingSwap(const boost::shared_ptr<SwapIndex> &index,
                       const Date &expiry, const Period &tenor) const {

            CachedSwapKey k = {index,expiry,tenor};
            CacheType::iterator i = swapCache_.find(k);
            if (i == swapCache_.end()) {
                boost::shared_ptr<VanillaSwap> underlying =
                    index->clone(tenor)->underlyingSwap(expiry);
                swapCache_.insert(std::make_pair(k, underlying));
                return underlying;
            }
            return i->second;
        }

best
Peter

On 18 July 2014 11:17, cheng li <[hidden email]> wrote:

> Hi Lugi and Peter,
>
> I compiled it with VS2012. The error message reads as, e.g.
> Error   97      error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp)     D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp     225     1       QuantLib
>
> All these errors points line 220 and 225 in gaussian1dmodel.hpp.
>
> Regards,
> Cheng
>
> -----邮件原件-----
> 发件人: Luigi Ballabio [mailto:[hidden email]]
> 发送时间: 2014年7月18日 16:06
> 收件人: cheng li
> 抄送: Peter Caspers; QuantLib users
> 主题: Re: [Quantlib-users] C++ 11 Initializer lists features not
> supported in VS 2010/2012
>
> As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct
> initialization and it was in C++03 already, and even in C. (For
> instance, see the initialization of AmericanOptionData values[] in
> test-suite/americanoption.cpp.) In fact, g++ compiles it even with the
> -std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?
>
> Luigi
>
>
> On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:
>> Hi Peter,
>>
>>
>>
>> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
>> initializer lists feature is used. As I tested this feature is not
>> supported in vs 2010/2012. So for backward compatibility, should we remove it?
>>
>>
>>
>> Regards,
>>
>> Cheng
>>
>>
>> ---------------------------------------------------------------------
>> -
>> -------- Want fast and easy access to all the code in your enterprise?
>> Index and search up to 200,000 lines of code with a free copy of
>> Black Duck Code Sight - the same software that powers the world's
>> largest code search on Ohloh, the Black Duck Open Hub! Try it now.
>> http://p.sf.net/sfu/bds
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>
>


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: 答复: C++ 11 Initializer lists features not supported in VS 2010/2012

Peter Caspers-4
ok, let's take this already, just give a shout if you get other messages
Peter

On 18 July 2014 18:31, cheng.li <[hidden email]> wrote:

> Yes, on my side, it works on vs 2012. I will try vs 2010 later.
>
> Regards,
> Cheng
>
> -----邮件原件-----
> 发件人: Peter Caspers [mailto:[hidden email]]
> 发送时间: 2014年7月18日 20:24
> 收件人: cheng li
> 抄送: Luigi Ballabio; QuantLib users
> 主题: Re: 答复: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012
>
> would that work then (starting at line 216) ?
>
>         boost::shared_ptr<VanillaSwap>
>         underlyingSwap(const boost::shared_ptr<SwapIndex> &index,
>                        const Date &expiry, const Period &tenor) const {
>
>             CachedSwapKey k = {index,expiry,tenor};
>             CacheType::iterator i = swapCache_.find(k);
>             if (i == swapCache_.end()) {
>                 boost::shared_ptr<VanillaSwap> underlying =
>                     index->clone(tenor)->underlyingSwap(expiry);
>                 swapCache_.insert(std::make_pair(k, underlying));
>                 return underlying;
>             }
>             return i->second;
>         }
>
> best
> Peter
>
> On 18 July 2014 11:17, cheng li <[hidden email]> wrote:
>> Hi Lugi and Peter,
>>
>> I compiled it with VS2012. The error message reads as, e.g.
>> Error   97      error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp)     D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp     225     1       QuantLib
>>
>> All these errors points line 220 and 225 in gaussian1dmodel.hpp.
>>
>> Regards,
>> Cheng
>>
>> -----邮件原件-----
>> 发件人: Luigi Ballabio [mailto:[hidden email]]
>> 发送时间: 2014年7月18日 16:06
>> 收件人: cheng li
>> 抄送: Peter Caspers; QuantLib users
>> 主题: Re: [Quantlib-users] C++ 11 Initializer lists features not
>> supported in VS 2010/2012
>>
>> As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct
>> initialization and it was in C++03 already, and even in C. (For
>> instance, see the initialization of AmericanOptionData values[] in
>> test-suite/americanoption.cpp.) In fact, g++ compiles it even with the
>> -std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?
>>
>> Luigi
>>
>>
>> On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:
>>> Hi Peter,
>>>
>>>
>>>
>>> As I saw in the latest trunk, in the files, e.g. gaussian1dmodel.hpp,
>>> initializer lists feature is used. As I tested this feature is not
>>> supported in vs 2010/2012. So for backward compatibility, should we remove it?
>>>
>>>
>>>
>>> Regards,
>>>
>>> Cheng
>>>
>>>
>>> ---------------------------------------------------------------------
>>> -
>>> -------- Want fast and easy access to all the code in your enterprise?
>>> Index and search up to 200,000 lines of code with a free copy of
>>> Black Duck Code Sight - the same software that powers the world's
>>> largest code search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio>
>>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: 答复: 答复: C++ 11 Initializer lists features not supported in VS 2010/2012

cheng li
Vs 2010 try finished. Your fix works great.

Regards,
Cheng

-----邮件原件-----
发件人: Peter Caspers [mailto:[hidden email]]
发送时间: 2014年7月19日 0:52
收件人: cheng.li
抄送: Luigi Ballabio; QuantLib users
主题: Re: 答复: 答复: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012

ok, let's take this already, just give a shout if you get other messages Peter

On 18 July 2014 18:31, cheng.li <[hidden email]> wrote:

> Yes, on my side, it works on vs 2012. I will try vs 2010 later.
>
> Regards,
> Cheng
>
> -----邮件原件-----
> 发件人: Peter Caspers [mailto:[hidden email]]
> 发送时间: 2014年7月18日 20:24
> 收件人: cheng li
> 抄送: Luigi Ballabio; QuantLib users
> 主题: Re: 答复: [Quantlib-users] C++ 11 Initializer lists features not
> supported in VS 2010/2012
>
> would that work then (starting at line 216) ?
>
>         boost::shared_ptr<VanillaSwap>
>         underlyingSwap(const boost::shared_ptr<SwapIndex> &index,
>                        const Date &expiry, const Period &tenor) const
> {
>
>             CachedSwapKey k = {index,expiry,tenor};
>             CacheType::iterator i = swapCache_.find(k);
>             if (i == swapCache_.end()) {
>                 boost::shared_ptr<VanillaSwap> underlying =
>                     index->clone(tenor)->underlyingSwap(expiry);
>                 swapCache_.insert(std::make_pair(k, underlying));
>                 return underlying;
>             }
>             return i->second;
>         }
>
> best
> Peter
>
> On 18 July 2014 11:17, cheng li <[hidden email]> wrote:
>> Hi Lugi and Peter,
>>
>> I compiled it with VS2012. The error message reads as, e.g.
>> Error   97      error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp)     D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp     225     1       QuantLib
>>
>> All these errors points line 220 and 225 in gaussian1dmodel.hpp.
>>
>> Regards,
>> Cheng
>>
>> -----邮件原件-----
>> 发件人: Luigi Ballabio [mailto:[hidden email]]
>> 发送时间: 2014年7月18日 16:06
>> 收件人: cheng li
>> 抄送: Peter Caspers; QuantLib users
>> 主题: Re: [Quantlib-users] C++ 11 Initializer lists features not
>> supported in VS 2010/2012
>>
>> As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct
>> initialization and it was in C++03 already, and even in C. (For
>> instance, see the initialization of AmericanOptionData values[] in
>> test-suite/americanoption.cpp.) In fact, g++ compiles it even with
>> the
>> -std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?
>>
>> Luigi
>>
>>
>> On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:
>>> Hi Peter,
>>>
>>>
>>>
>>> As I saw in the latest trunk, in the files, e.g.
>>> gaussian1dmodel.hpp, initializer lists feature is used. As I tested
>>> this feature is not supported in vs 2010/2012. So for backward compatibility, should we remove it?
>>>
>>>
>>>
>>> Regards,
>>>
>>> Cheng
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> -
>>> -------- Want fast and easy access to all the code in your enterprise?
>>> Index and search up to 200,000 lines of code with a free copy of
>>> Black Duck Code Sight - the same software that powers the world's
>>> largest code search on Ohloh, the Black Duck Open Hub! Try it now.
>>> http://p.sf.net/sfu/bds
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio>
>>
>


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: 答复: 答复: C++ 11 Initializer lists features not supported in VS 2010/2012

Peter Caspers-4
that's good, thank you for your help
Peter

On 19 July 2014 03:56, cheng.li <[hidden email]> wrote:

> Vs 2010 try finished. Your fix works great.
>
> Regards,
> Cheng
>
> -----邮件原件-----
> 发件人: Peter Caspers [mailto:[hidden email]]
> 发送时间: 2014年7月19日 0:52
> 收件人: cheng.li
> 抄送: Luigi Ballabio; QuantLib users
> 主题: Re: 答复: 答复: [Quantlib-users] C++ 11 Initializer lists features not supported in VS 2010/2012
>
> ok, let's take this already, just give a shout if you get other messages Peter
>
> On 18 July 2014 18:31, cheng.li <[hidden email]> wrote:
>> Yes, on my side, it works on vs 2012. I will try vs 2010 later.
>>
>> Regards,
>> Cheng
>>
>> -----邮件原件-----
>> 发件人: Peter Caspers [mailto:[hidden email]]
>> 发送时间: 2014年7月18日 20:24
>> 收件人: cheng li
>> 抄送: Luigi Ballabio; QuantLib users
>> 主题: Re: 答复: [Quantlib-users] C++ 11 Initializer lists features not
>> supported in VS 2010/2012
>>
>> would that work then (starting at line 216) ?
>>
>>         boost::shared_ptr<VanillaSwap>
>>         underlyingSwap(const boost::shared_ptr<SwapIndex> &index,
>>                        const Date &expiry, const Period &tenor) const
>> {
>>
>>             CachedSwapKey k = {index,expiry,tenor};
>>             CacheType::iterator i = swapCache_.find(k);
>>             if (i == swapCache_.end()) {
>>                 boost::shared_ptr<VanillaSwap> underlying =
>>                     index->clone(tenor)->underlyingSwap(expiry);
>>                 swapCache_.insert(std::make_pair(k, underlying));
>>                 return underlying;
>>             }
>>             return i->second;
>>         }
>>
>> best
>> Peter
>>
>> On 18 July 2014 11:17, cheng li <[hidden email]> wrote:
>>> Hi Lugi and Peter,
>>>
>>> I compiled it with VS2012. The error message reads as, e.g.
>>> Error   97      error C2143: syntax error : missing ';' before '{' (ql\experimental\models\nonstandardswaption.cpp)     D:\dev\svn\CAL\quantlib\QuantLib\ql\experimental\models\gaussian1dmodel.hpp     225     1       QuantLib
>>>
>>> All these errors points line 220 and 225 in gaussian1dmodel.hpp.
>>>
>>> Regards,
>>> Cheng
>>>
>>> -----邮件原件-----
>>> 发件人: Luigi Ballabio [mailto:[hidden email]]
>>> 发送时间: 2014年7月18日 16:06
>>> 收件人: cheng li
>>> 抄送: Peter Caspers; QuantLib users
>>> 主题: Re: [Quantlib-users] C++ 11 Initializer lists features not
>>> supported in VS 2010/2012
>>>
>>> As in gaussiam1dmodel.hpp at line 220? As far as I see, that's struct
>>> initialization and it was in C++03 already, and even in C. (For
>>> instance, see the initialization of AmericanOptionData values[] in
>>> test-suite/americanoption.cpp.) In fact, g++ compiles it even with
>>> the
>>> -std=c++03 flag. But I seem to remember that it might or might not work depending on the compiler and types involved. Does it give you an error in VC++10/12?
>>>
>>> Luigi
>>>
>>>
>>> On Fri, Jul 18, 2014 at 4:21 AM, cheng li <[hidden email]> wrote:
>>>> Hi Peter,
>>>>
>>>>
>>>>
>>>> As I saw in the latest trunk, in the files, e.g.
>>>> gaussian1dmodel.hpp, initializer lists feature is used. As I tested
>>>> this feature is not supported in vs 2010/2012. So for backward compatibility, should we remove it?
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Cheng
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> -
>>>> -------- Want fast and easy access to all the code in your enterprise?
>>>> Index and search up to 200,000 lines of code with a free copy of
>>>> Black Duck Code Sight - the same software that powers the world's
>>>> largest code search on Ohloh, the Black Duck Open Hub! Try it now.
>>>> http://p.sf.net/sfu/bds
>>>> _______________________________________________
>>>> QuantLib-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>
>>>
>>>
>>>
>>> --
>>> <https://implementingquantlib.blogspot.com>
>>> <https://twitter.com/lballabio>
>>>
>>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users