OpenDDS lacks pre-C++17 support for `optional`
commitc235225dd99779b48fbd9cdb0dfa7fa389625d07
authorJustin R. Wilson <wilsonj@unityfoundation.io>
Fri, 10 May 2024 17:43:13 +0000 (10 12:43 -0500)
committerJustin R. Wilson <wilsonj@unityfoundation.io>
Tue, 14 May 2024 19:55:45 +0000 (14 14:55 -0500)
tree8ed290b0762caa9422e01fc2c0e5345f5bc92b1f
parent81660e1d67b2230b029c0cbe2430ab4317129ea2
OpenDDS lacks pre-C++17 support for `optional`

Problem
-------

OpenDDS has an implementation of `optional` in XTypes.  However, it is
not an exact replacement for `std::optional`.  Providing an
implementation of `optional` will ease issues with the impending
`@optional` implementation.

Solution
--------

Provide an implementation of `optional` when `std::optional` is not
available.
dds/DCPS/XTypes/TypeObject.cpp
dds/DCPS/XTypes/TypeObject.h
dds/DCPS/optional.h [new file with mode: 0644]
dds/idl/typeobject_generator.cpp
dds/idl/typeobject_generator.h
tests/DCPS/Messenger/run_test.pl
tests/unit-tests/dds/DCPS/XTypes/TypeObject.cpp
tests/unit-tests/dds/DCPS/optional.cpp [new file with mode: 0644]