Skip to content

Commit 579bb49

Browse files
Fix .editorconfig
Signed-off-by: Christian Parpart <[email protected]>
1 parent 6b53934 commit 579bb49

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,14 @@ insert_final_newline = true
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true
10+
11+
[LICENSE.txt]
12+
end_of_line = unset
13+
indent_size = unset
14+
insert_final_newline = unset
15+
16+
[.clang-format]
17+
indent_size = 2
18+
19+
[*.yml]
20+
indent_size = 2

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ struct Wrap
9191

9292

9393
auto x_coord = Wrap([](rho_type rho){ return unbox(rho); },
94-
[](theta_type theta){ return sin(unbox(theta)); },
95-
[](phi_type phi){ return cos(unbox(phi)); }
94+
[](theta_type theta){ return sin(unbox(theta)); },
95+
[](phi_type phi){ return cos(unbox(phi)); }
9696
);
9797

9898
int main()

include/boxed-cpp/boxed.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ constexpr bool is_boxed = helper::is_boxed<T>::value;
3737
template <typename T, typename Tag>
3838
struct boxed
3939
{
40-
static_assert(std::is_enum_v<T> || std::is_integral_v<T> || std::is_floating_point_v<T>,
41-
"Boxing is only useful on integral & floating point types.");
40+
// clang-format off
41+
static_assert(
42+
std::is_enum_v<T> || std::is_integral_v<T> || std::is_floating_point_v<T>,
43+
"Boxing is only useful on integral & floating point types."
44+
);
45+
// clang-format on
4246

4347
using inner_type = T;
4448
using element_type = T;

test-boxed-cpp.cpp

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,10 @@ TEST_CASE("boxed_cast")
3838
static_assert(std::is_same_v<decltype(t), To const>);
3939
}
4040

41-
namespace tags
42-
{
43-
struct N
44-
{
45-
};
46-
struct Z
47-
{
48-
};
49-
} // namespace tags
41+
// clang-format off
42+
namespace tags { struct N {}; struct Z {}; }
43+
// clang-format on
44+
5045
using N = boxed::boxed<unsigned int, tags::N>;
5146
using Z = boxed::boxed<signed int, tags::Z>;
5247

@@ -129,13 +124,13 @@ TEST_CASE("all options for unbox")
129124

130125
// clang-format off
131126
template<typename ...Ts>
132-
struct not_same{};
127+
struct not_same{};
133128

134129
template<typename T>
135-
struct not_same<T,T> : virtual std::false_type {};
130+
struct not_same<T,T> : virtual std::false_type {};
136131

137132
template<typename T,typename S>
138-
struct not_same<T,S> : virtual std::true_type {} ;
133+
struct not_same<T,S> : virtual std::true_type {} ;
139134

140135
template <typename ...T>
141136
struct all_different : std::false_type {};
@@ -193,11 +188,13 @@ struct Wrap<T, Rest...>
193188
}
194189
};
195190

196-
auto x_coord = Wrap<rho_type, theta_type, phi_type> { [](rho_type rho) { return unbox(rho); },
197-
[](theta_type theta) { return sin(unbox(theta)); },
198-
[](phi_type phi) {
199-
return cos(unbox(phi));
200-
} };
191+
// clang-format off
192+
auto x_coord = Wrap<rho_type, theta_type, phi_type> {
193+
[](rho_type rho) { return unbox(rho); },
194+
[](theta_type theta) { return sin(unbox(theta)); },
195+
[](phi_type phi) { return cos(unbox(phi)); }
196+
};
197+
// clang-format on
201198

202199
TEST_CASE("advanced usage")
203200
{

0 commit comments

Comments
 (0)