VCCC  2024.05
VisualCamp Common C++ library
swap.h
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2021/05/24.
3 # */
4 #
5 # ifndef VCCC_OPTIONAL_SWAP_H_
6 # define VCCC_OPTIONAL_SWAP_H_
7 #
8 # include <algorithm>
9 # include <type_traits>
10 # include <utility>
11 #
15 
16 namespace std {
17 
26 template<typename T,
27  ::std::enable_if_t<
29  int> = 0>
30 void swap(::vccc::optional<T>& lhs, ::vccc::optional<T>& rhs) noexcept(noexcept(lhs.swap(rhs))) {
31  lhs.swap(rhs);
32 }
33 
36 
37 } // namespace std
38 
39 # endif // VCCC_OPTIONAL_SWAP_H_
a wrapper that may or may not hold an object
Definition: optional.h:46
void swap(::vccc::optional< T > &lhs, ::vccc::optional< T > &rhs) noexcept(noexcept(lhs.swap(rhs)))
Definition: swap.h:30
Definition: matrix.hpp:495
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: is_swappable.hpp:119