Skip to content

Commit d18b903

Browse files
committed
Fix clang-format issues
1 parent c7289da commit d18b903

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

examples/optional_ref.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ int example1() {
5252
return 0;
5353
}
5454

55-
5655
struct derived;
5756
extern derived d;
5857
struct base {

include/beman/optional/optional.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,17 +1095,17 @@ class optional<T&> {
10951095
constexpr optional(const optional& rhs) noexcept = default;
10961096

10971097
template <class Arg>
1098-
requires(std::is_constructible_v<T&, Arg> &&
1099-
!detail::reference_constructs_from_temporary_v<T&, Arg>)
1098+
requires(std::is_constructible_v<T&, Arg> && !detail::reference_constructs_from_temporary_v<T&, Arg>)
11001099
constexpr explicit optional(in_place_t, Arg&& arg);
11011100

11021101
template <class U>
11031102
requires(std::is_constructible_v<T&, U> && !(std::is_same_v<std::remove_cvref_t<U>, in_place_t>) &&
11041103
!(std::is_same_v<std::remove_cvref_t<U>, optional>) &&
11051104
!detail::reference_constructs_from_temporary_v<T&, U>)
1106-
constexpr explicit(!std::is_convertible_v<U, T&>) optional(U&& u) noexcept(std::is_nothrow_constructible_v<T&, U>)
1107-
{ // Creates a variable, \tcode{r}, as if by \tcode{T\& r(std::forward<Arg>(arg));} and then initializes
1108-
// \exposid{val} with \tcode{addressof(r)}
1105+
constexpr explicit(!std::is_convertible_v<U, T&>) optional(U&& u) noexcept(
1106+
std::is_nothrow_constructible_v<T&, U>) { // Creates a variable, \tcode{r}, as if by \tcode{T\&
1107+
// r(std::forward<Arg>(arg));} and then initializes \exposid{val}
1108+
// with \tcode{addressof(r)}
11091109
T& r(std::forward<U>(u));
11101110
value_ = std::addressof(r);
11111111
}
@@ -1216,11 +1216,10 @@ constexpr optional<T&>::optional(nullopt_t) noexcept : value_(nullptr) {}
12161216

12171217
template <class T>
12181218
template <class Arg>
1219-
requires(std::is_constructible_v<T&, Arg> &&
1220-
!detail::reference_constructs_from_temporary_v<T&, Arg>)
1221-
constexpr optional<T&>::optional(in_place_t, Arg&& arg)
1222-
{ // Creates a variable, \tcode{r}, as if by \tcode{T\& r(std::forward<Arg>(arg));} and then initializes \exposid{val}
1223-
// with \tcode{addressof(r)}
1219+
requires(std::is_constructible_v<T&, Arg> && !detail::reference_constructs_from_temporary_v<T&, Arg>)
1220+
constexpr optional<T&>::optional(
1221+
in_place_t, Arg&& arg) { // Creates a variable, \tcode{r}, as if by \tcode{T\& r(std::forward<Arg>(arg));} and
1222+
// then initializes \exposid{val} with \tcode{addressof(r)}
12241223
T& r(std::forward<Arg>(arg));
12251224
value_ = std::addressof(r);
12261225
}

0 commit comments

Comments
 (0)