Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Switch from boost to ext and ql includes

Open eltoder opened this issue 1 year ago • 4 comments

Upstream QuantLib is moving from boost classes to std classes for shared_ptr, optional, etc. To ease the transition they added the ext:: namespace which has aliases to either boost or std classes depending on the config options. Are you planning to update your code to use the ext namespace to make it closer to the upstream? This is mostly a search and replace exercise but there are a few thousand hits.

eltoder avatar May 19 '23 13:05 eltoder

@pcaspers could you opine please?

eltoder avatar May 26 '23 03:05 eltoder

@eltoder Yes this is already on our radar. I expect this to be done in the next release.

pcaspers avatar May 26 '23 06:05 pcaspers

We did not manage to get this done for the 10th release, unfortunately. We will keep it on our roadmap for the next one (end of September) . Regards, Roland

QuaternionRisk avatar Jun 21 '23 20:06 QuaternionRisk

Here is, what I had to do to achieve this. Perl or sed can be used to do this with a single command:

  1. Replace boost::(make_shared|shared_ptr|optional|dynamic_pointer_cast|none|static_pointer_cast) with QuantLib::ext::\1 throughout.
  2. Subsequently replace ext::none with ext::nullopt.

If only figuring out the fairSpreadClean() added to the fork were as easy :-/

UnitedMarsupials avatar Sep 13 '23 20:09 UnitedMarsupials