Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip trailing whitespace #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jamroot
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ install out
reference_wrapper_test
lambda_overload_test
hashable_test
;
;
2 changes: 1 addition & 1 deletion include/mapbox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ class variant
#else
data_type data;
#endif

public:
VARIANT_INLINE variant() noexcept(std::is_nothrow_default_constructible<first_type>::value)
: type_index(sizeof...(Types)-1)
Expand Down
4 changes: 2 additions & 2 deletions include/mapbox/variant_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct visitor<Fn> : Fn
using Fn::operator();

template<typename T>
visitor(T&& fn) : Fn(std::forward<T>(fn)) {}
visitor(T&& fn) : Fn(std::forward<T>(fn)) {}
};

template <typename Fn, typename... Fns>
Expand All @@ -36,7 +36,7 @@ visitor<typename std::decay<Fns>::type...> make_visitor(Fns&&... fns)
return visitor<typename std::decay<Fns>::type...>
(std::forward<Fns>(fns)...);
}

} // namespace util
} // namespace mapbox

Expand Down
12 changes: 6 additions & 6 deletions test/lambda_overload_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void test_match_singleton()
{
variant<int> singleton = 5;
singleton.match([](int) {});

auto lambda = [](int) {};
singleton.match(lambda);
}
Expand Down Expand Up @@ -118,18 +118,18 @@ void test_match_overloads_capture()
struct MovableOnly
{
MovableOnly() = default;

MovableOnly(MovableOnly&&) = default;
MovableOnly& operator=(MovableOnly&&) = default;
};

struct MovableCopyable
{
MovableCopyable() = default;

MovableCopyable(MovableCopyable&&) = default;
MovableCopyable& operator=(MovableCopyable&&) = default;

MovableCopyable(const MovableCopyable&) = default;
MovableCopyable& operator=(const MovableCopyable&) = default;
};
Expand All @@ -145,10 +145,10 @@ void test_match_overloads_init_capture()
{
auto lambda = [p = MovableCopyable{}](auto&&) {};
rv.match(lambda);

rv.match([p = MovableOnly{}](Response) { std::cout << "Response\n"; },
[p = MovableOnly{}](Error) { std::cout << "Error\n"; });
}
}
{
auto lambda = [](Error) { std::cout << "Error\n"; };
rv.match([p = MovableOnly{}](Response) { std::cout << "Response\n"; },
Expand Down