Non-copyable KnuthUniformRng

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

Non-copyable KnuthUniformRng

Slava Mazur-2
The following declaration in KnuthUniformRng effectively makes this class non-copyable:

std::vector<double>::const_iterator ranf_arr_ptr, _arr_sentinel;

However, KnuthUniformRng is not declared as such. As a result, any attempt to call next() of a copy of any temporal instance of KnuthUniformRng ends up in a crash (let me know if further elaboration is needed). I don't believe this is an intended design. There are two possible ways to fix: either to keep indices instead of const_iterator, or to implement a copy constructor and an assignment operator. I personally prefer the former, but can provide any fix community will choose.

Best,

Slava Mazur



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-copyable KnuthUniformRng

Luigi Ballabio
On Fri, 2010-10-29 at 17:23 -0400, Slava Mazur wrote:
> The following declaration in KnuthUniformRng effectively makes this
> class non-copyable:
>
> std::vector<double>::const_iterator ranf_arr_ptr, _arr_sentinel;

You're right.  Indices instead of iterators are fine with me.

Thanks,
        Luigi



--

Weiler's Law:
Nothing is impossible for the man who doesn't have to
do it himself.



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

VC++ 10 Boost includes?

Dominick Samperi
On the recent addition of solution files for VC++ 10, has anyone
found a simple way to add additional include directories
and libs? This used to be done using Tools/ Options
/ Projects and Solutions / VC++ Directories, and in
this way the settings would apply to all projects in a solution.

But this feature has been deprecated in VC++ 10, and instead
user property sheets are supposed to be used, but I don't
see how to do this so that it applies to all projects in
a solution (globally).

This can be done on a project-by-project basis using
Properties / Configuration Properties / VC++ Directories,
but this would have do be done for each project, and
for each configuration (Debug, Release, x32, x64, etc.).
Very tedious.

A solution that works for the Express edition is of
course preferred.

Thanks,
Dominick



------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment.   Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: VC++ 10 Boost includes?

Piter Dias-4
Dominick,

>> But this feature has been deprecated in VC++ 10, and instead user
property sheets are supposed to be used, but I don't see how to do this so
that it applies to all projects in a solution (globally).

I found several links about, like
http://efreedom.com/Question/1-2629421/Use-Boost-Visual-Studio-2010 and
http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx.
However, I didn't find anything like Microsoft.Cpp.<Platform>.user or
Microsoft.Cpp.Win32.user in VC++ Express 2010 so I opened C:\Users\<your
login>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props
and add the below

I appreciate if someone sends a screenshot of such
(Microsoft.Cpp.<Platform>.user or Microsoft.Cpp.Win32.user) options in the
GUI once they are supposed to be the right way to setup includes globally.

<PropertyGroup>
        <IncludePath>C:\Users\<your
login>\Development\include\boost-1_44;$(IncludePath)</IncludePath>
</PropertyGroup>

Thanks a lot,

_______________________
Piter Dias
[hidden email]


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: VC++ 10 Boost includes?

Luigi Ballabio
In reply to this post by Dominick Samperi
On Tue, 2010-11-02 at 20:32 -0400, Dominick Samperi wrote:

> On the recent addition of solution files for VC++ 10, has anyone
> found a simple way to add additional include directories
> and libs? This used to be done using Tools/ Options
> / Projects and Solutions / VC++ Directories, and in
> this way the settings would apply to all projects in a solution.
>
> But this feature has been deprecated in VC++ 10, and instead
> user property sheets are supposed to be used, but I don't
> see how to do this so that it applies to all projects in
> a solution (globally).

Yes, I had to go through the same ordeal.  After much searching, what I
did was:
- select View/Property Manager from the IDE menu;
- open the subtree for any project and configuration;
- you'll find a Microsoft.Cpp.Win32.User property page inside.
- right-click and select Properties.  Inside the dialog there's the good
old "VC++ directories" option.

The trick is that this particular page is shared, so when you edit it in
one project/configuration they all should see it (I don't remember if I
restarted the IDE after modifying it, though.)

Luigi


--

I hate quotations.
-- Ralph Waldo Emerson



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev