Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ext::optional for C++17 #2042

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion QuantLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,6 @@
<ClCompile Include="ql\instrument.cpp" />
<ClCompile Include="ql\interestrate.cpp" />
<ClCompile Include="ql\money.cpp" />
<ClCompile Include="ql\optional.cpp" />
<ClCompile Include="ql\position.cpp" />
<ClCompile Include="ql\prices.cpp" />
<ClCompile Include="ql\rebatedexercise.cpp" />
Expand Down
1 change: 0 additions & 1 deletion QuantLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -6662,7 +6662,6 @@
<ClCompile Include="ql\instrument.cpp" />
<ClCompile Include="ql\interestrate.cpp" />
<ClCompile Include="ql\money.cpp" />
<ClCompile Include="ql\optional.cpp" />
<ClCompile Include="ql\position.cpp" />
<ClCompile Include="ql\prices.cpp" />
<ClCompile Include="ql\settings.cpp" />
Expand Down
5 changes: 2 additions & 3 deletions ql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ set(QL_SOURCES
math/integrals/integral.cpp
math/integrals/kronrodintegral.cpp
math/integrals/segmentintegral.cpp
math/interpolations/chebyshevinterpolation.cpp
math/interpolations/chebyshevinterpolation.cpp
math/matrix.cpp
math/matrixutilities/basisincompleteordered.cpp
math/matrixutilities/bicgstab.cpp
Expand Down Expand Up @@ -646,7 +646,6 @@ set(QL_SOURCES
models/volatility/constantestimator.cpp
models/volatility/garch.cpp
money.cpp
optional.cpp
patterns/observable.cpp
position.cpp
prices.cpp
Expand Down Expand Up @@ -1451,7 +1450,7 @@ set(QL_HEADERS
math/interpolations/backwardflatlinearinterpolation.hpp
math/interpolations/bicubicsplineinterpolation.hpp
math/interpolations/bilinearinterpolation.hpp
math/interpolations/chebyshevinterpolation.hpp
math/interpolations/chebyshevinterpolation.hpp
math/interpolations/convexmonotoneinterpolation.hpp
math/interpolations/cubicinterpolation.hpp
math/interpolations/extrapolation.hpp
Expand Down
4 changes: 1 addition & 3 deletions ql/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ cpp_files = \
instrument.cpp \
interestrate.cpp \
money.cpp \
optional.cpp \
position.cpp \
prices.cpp \
rebatedexercise.cpp \
Expand Down Expand Up @@ -103,7 +102,7 @@ else

libQuantLib_la_SOURCES = $(cpp_files)

EXTRA_DIST =
EXTRA_DIST =

endif

Expand Down Expand Up @@ -180,4 +179,3 @@ install-data-hook:
rm .config.hpp
depend:
makedepend $(INCLUDES) -- $(CFLAGS) -- $(SOURCES)

29 changes: 0 additions & 29 deletions ql/optional.cpp

This file was deleted.

4 changes: 1 addition & 3 deletions ql/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ namespace QuantLib::ext {

#if defined(QL_USE_STD_OPTIONAL)
using std::optional; // NOLINT(misc-unused-using-decls)
// here we can assume C++17
inline constexpr const std::nullopt_t& nullopt = std::nullopt;
#else
using boost::optional; // NOLINT(misc-unused-using-decls)
// here we can't
extern const boost::none_t& nullopt;
inline constexpr const boost::none_t& nullopt = boost::none;
#endif

}
Expand Down
Loading