Skip to content

Commit

Permalink
Update copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed Jan 25, 2018
1 parent 5f9a270 commit 132167c
Show file tree
Hide file tree
Showing 65 changed files with 266 additions and 347 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
# Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
# This file is subject to the license terms in the LICENSE file
# found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
# Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
# This file is subject to the license terms in the LICENSE file
# found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
# Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
# This file is subject to the license terms in the LICENSE file
# found in the top-level directory of this distribution.

Expand Down
6 changes: 3 additions & 3 deletions example/constrained.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -58,8 +58,8 @@ using sanitized_string = ts::tagged_type<std::string, sanitized>;
using unsanitized_string = ts::tagged_type<std::string, unsanitized>;

unsanitized_string get_form_data();
sanitized_string sanitize(const unsanitized_string& str);
void execute_query(const sanitized_string& str);
sanitized_string sanitize(const unsanitized_string& str);
void execute_query(const sanitized_string& str);

// now impossible to accidentally use unsanitized strings
void do_stuff()
Expand Down
2 changes: 1 addition & 1 deletion example/optional.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion example/output_parameter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
13 changes: 6 additions & 7 deletions example/strong_typedef.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -40,12 +40,11 @@ void use_handle(handle h)
}

// integer representing a distance
struct distance
: ts::strong_typedef<distance, unsigned>, // required
ts::strong_typedef_op::equality_comparison<distance>, // for operator==/operator!=
ts::strong_typedef_op::relational_comparison<distance>, // for operator< etc.
ts::strong_typedef_op::
integer_arithmetic<distance> // all arithmetic operators that make sense for integers
struct distance : ts::strong_typedef<distance, unsigned>, // required
ts::strong_typedef_op::equality_comparison<distance>, // for operator==/operator!=
ts::strong_typedef_op::relational_comparison<distance>, // for operator< etc.
ts::strong_typedef_op::integer_arithmetic<
distance> // all arithmetic operators that make sense for integers
{
using strong_typedef::strong_typedef;
};
Expand Down
2 changes: 1 addition & 1 deletion example/types.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion external/external.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
# Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
# This file is subject to the license terms in the LICENSE file
# found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/arithmetic_policy.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/boolean.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
12 changes: 6 additions & 6 deletions include/type_safe/bounded_type.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -267,14 +267,14 @@ namespace type_safe
/// A value is valid if it is between two given bounds but not the bounds themselves.
template <typename T, typename LowerBound = dynamic_bound,
typename UpperBound = dynamic_bound>
using open_interval = bounded<T, open, open, LowerBound, UpperBound>;
using open_interval = bounded<T, open, open, LowerBound, UpperBound>;

/// A `Constraint` for the [ts::constrained_type]().
///
/// A value is valid if it is between two given bounds or the bounds themselves.
template <typename T, typename LowerBound = dynamic_bound,
typename UpperBound = dynamic_bound>
using closed_interval = bounded<T, closed, closed, LowerBound, UpperBound>;
using closed_interval = bounded<T, closed, closed, LowerBound, UpperBound>;
} // namespace constraints

/// \exclude
Expand Down Expand Up @@ -367,9 +367,9 @@ namespace type_safe
typename LowerBound = constraints::dynamic_bound,
typename UpperBound = constraints::dynamic_bound,
typename Verifier = assertion_verifier>
using bounded_type = constrained_type<T, constraints::bounded<T, LowerInclusive, UpperInclusive,
LowerBound, UpperBound>,
Verifier>;
using bounded_type = constrained_type<
T, constraints::bounded<T, LowerInclusive, UpperInclusive, LowerBound, UpperBound>,
Verifier>;

inline namespace literals
{
Expand Down
24 changes: 9 additions & 15 deletions include/type_safe/compact_optional.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -61,9 +61,7 @@ namespace type_safe

/// \effects Initializes it in the state without value,
/// i.e. sets the storage to the invalid value.
compact_optional_storage() noexcept : storage_(CompactPolicy::invalid_value())
{
}
compact_optional_storage() noexcept : storage_(CompactPolicy::invalid_value()) {}

/// \effects Creates a temporary `value_type` by perfectly forwarding `args`,
/// converts that to the `storage_type` and assigns it.
Expand Down Expand Up @@ -94,9 +92,7 @@ namespace type_safe
storage_ = std::move(other.storage_);
}

void create_value_explicit()
{
}
void create_value_explicit() {}

/// \effects Copy assigns the `storage_type`.
void copy_value(const compact_optional_storage& other)
Expand Down Expand Up @@ -166,10 +162,9 @@ namespace type_safe
/// \group get_value_or
/// \param 1
/// \exclude
template <typename U,
typename =
typename std::enable_if<std::is_copy_constructible<value_type>::value
&& std::is_convertible<U&&, value_type>::value>::type>
template <typename U, typename = typename std::enable_if<
std::is_copy_constructible<value_type>::value
&& std::is_convertible<U&&, value_type>::value>::type>
value_type get_value_or(U&& u) const TYPE_SAFE_LVALUE_REF
{
return has_value() ? get_value() : static_cast<value_type>(std::forward<U>(u));
Expand All @@ -179,10 +174,9 @@ namespace type_safe
/// \group get_value_or
/// \param 1
/// \exclude
template <typename U,
typename =
typename std::enable_if<std::is_move_constructible<value_type>::value
&& std::is_convertible<U&&, value_type>::value>::type>
template <typename U, typename = typename std::enable_if<
std::is_move_constructible<value_type>::value
&& std::is_convertible<U&&, value_type>::value>::type>
value_type get_value_or(U&& u) &&
{
return has_value() ? std::move(get_value()) :
Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/config.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
17 changes: 7 additions & 10 deletions include/type_safe/constrained_type.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -131,9 +131,8 @@ namespace type_safe
}

/// \exclude
template <typename U,
typename = typename std::enable_if<!detail::is_valid<constraint_predicate,
U>::value>::type>
template <typename U, typename = typename std::enable_if<
!detail::is_valid<constraint_predicate, U>::value>::type>
constrained_type(U) = delete;

/// \effects Copies the value and predicate of `other`.
Expand Down Expand Up @@ -172,9 +171,8 @@ namespace type_safe
}

/// \exclude
template <typename U,
typename = typename std::enable_if<!detail::is_valid<constraint_predicate,
U>::value>::type>
template <typename U, typename = typename std::enable_if<
!detail::is_valid<constraint_predicate, U>::value>::type>
constrained_type& operator=(U) = delete;

/// \effects Copies the value and predicate from `other`.
Expand Down Expand Up @@ -286,9 +284,8 @@ namespace type_safe
}

/// \exclude
template <typename U,
typename = typename std::enable_if<!detail::is_valid<constraint_predicate,
U>::value>::type>
template <typename U, typename = typename std::enable_if<
!detail::is_valid<constraint_predicate, U>::value>::type>
constrained_type(U) = delete;

/// \returns A proxy object to provide verified write-access to the referred value.
Expand Down
6 changes: 2 additions & 4 deletions include/type_safe/deferred_construction.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -35,9 +35,7 @@ namespace type_safe
//=== constructors/assignment/destructor ===//
/// Default constructor.
/// \effects Creates it in the un-initialized state.
deferred_construction() noexcept : initialized_(false)
{
}
deferred_construction() noexcept : initialized_(false) {}

/// Copy constructor:
/// \effects If `other` is un-initialized, it will be un-initialized as well.
Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/aligned_union.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/all_of.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
6 changes: 3 additions & 3 deletions include/type_safe/detail/assert.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand All @@ -19,8 +19,8 @@ namespace type_safe
};

struct precondition_error_handler
: debug_assert::set_level<TYPE_SAFE_ENABLE_PRECONDITION_CHECKS>,
debug_assert::default_handler
: debug_assert::set_level<TYPE_SAFE_ENABLE_PRECONDITION_CHECKS>,
debug_assert::default_handler
{
};

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/assign_or_construct.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/constant_parser.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/copy_move_control.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/force_inline.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/is_nothrow_swappable.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/detail/map_invoke.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
12 changes: 5 additions & 7 deletions include/type_safe/detail/variant_impl.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down Expand Up @@ -58,9 +58,8 @@ namespace type_safe
{
struct visitor
{
template <
typename T,
typename = typename std::enable_if<std::is_copy_assignable<T>::value>::type>
template <typename T, typename = typename std::enable_if<
std::is_copy_assignable<T>::value>::type>
void do_assign(Union& dest, const T& value)
{
dest.value(union_type<T>{}) = value;
Expand Down Expand Up @@ -96,9 +95,8 @@ namespace type_safe
{
struct visitor
{
template <
typename T,
typename = typename std::enable_if<std::is_move_assignable<T>::value>::type>
template <typename T, typename = typename std::enable_if<
std::is_move_assignable<T>::value>::type>
void do_assign(Union& dest, T&& value)
{
dest.value(union_type<T>{}) = std::move(value);
Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/downcast.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
2 changes: 1 addition & 1 deletion include/type_safe/flag.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2016-2017 Jonathan Müller <[email protected]>
// Copyright (C) 2016-2018 Jonathan Müller <[email protected]>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.

Expand Down
Loading

0 comments on commit 132167c

Please sign in to comment.