aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-06-23 16:37:16 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-07-09 11:52:26 +0000
commit49a6c70d60623ab2d30840d95a6b0bcdf9ce6846 (patch)
tree008272f72e3b5bf169dacdc97c3459854a030d75 /gcc/rust/backend
parent763dd38a4924b23c73cafe9a3aab71d5b8494223 (diff)
downloadgcc-49a6c70d60623ab2d30840d95a6b0bcdf9ce6846.zip
gcc-49a6c70d60623ab2d30840d95a6b0bcdf9ce6846.tar.gz
gcc-49a6c70d60623ab2d30840d95a6b0bcdf9ce6846.tar.bz2
optional: Import tl's optional type
This is directly adapted from https://github.com/TartanLlama/optional. This class is tested for C++11 and on GCC 4.8, which is our target mimimum GCC version. This optional class provides multiple advantages over our existing implementation of Optional<T>: - Easier API (no static constructors) - Better method chaining (and_then, map...) - Harsher semantics (no assign-through on Optional<T&>) Over the std::optional type present in C++'s standard library, this type offers: - Optional references without going through std::reference_wrapper - Better method chaining For these reasons, I am in favor of importing it directly rather than adapt C++14's std::optional type to work with C++11 and GCC 4.8. gcc/rust/ChangeLog: * util/optional.h: New file.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions