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

Add the STRONG_TYPE_MODULE_EXPORT to all entities that should be exported, aka strong_type module part 1 #48

Open
wants to merge 1 commit into
base: main
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
3 changes: 2 additions & 1 deletion include/strong_type/affine_point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
template <typename D = void>
STRONG_TYPE_MODULE_EXPORT template <typename D = void>
struct affine_point
{
template <typename T>
Expand All @@ -36,6 +36,7 @@ struct subtractable<T, void_t<decltype(std::declval<const T&>() - std::declval<c
}


STRONG_TYPE_MODULE_EXPORT
template <typename D>
template <typename T, typename Tag, typename ... M>
class affine_point<D>::modifier<::strong::type<T, Tag, M...>>
Expand Down
6 changes: 3 additions & 3 deletions include/strong_type/arithmetic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace strong
{
struct arithmetic {
STRONG_TYPE_MODULE_EXPORT struct arithmetic {
template<typename T, typename = void>
class modifier
{
Expand All @@ -29,7 +29,7 @@ struct arithmetic {
};
};

template <typename T, typename Tag, typename ... Ms>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... Ms>
class arithmetic::modifier<strong::type<T, Tag, Ms...>, impl::void_t<decltype(std::declval<T>() * std::declval<T>() - std::declval<T>() / std::declval<T>())>>
{
using type = strong::type<T, Tag, Ms...>;
Expand Down Expand Up @@ -170,7 +170,7 @@ class arithmetic::modifier<strong::type<T, Tag, Ms...>, impl::void_t<decltype(st

}

template <typename T, typename Tag, typename ... Ms>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... Ms>
#if defined(__cpp_concepts)
requires strong::type_is_v<strong::type<T, Tag, Ms...>, strong::arithmetic>
class std::numeric_limits<strong::type<T, Tag, Ms...>>
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/bicrementable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace strong
{
struct bicrementable
STRONG_TYPE_MODULE_EXPORT struct bicrementable
{
template <typename T>
class modifier
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/bitarithmetic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
struct bitarithmetic
STRONG_TYPE_MODULE_EXPORT struct bitarithmetic
{
template <typename T, typename = void>
class modifier
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/boolean.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
struct boolean
STRONG_TYPE_MODULE_EXPORT struct boolean
{
template <typename T, typename = void>
class modifier
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/convertible_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct converter<

}

template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
struct convertible_to
{
template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/decrementable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
struct decrementable
STRONG_TYPE_MODULE_EXPORT struct decrementable
{
template <typename T, typename = void>
class modifier
Expand Down
4 changes: 2 additions & 2 deletions include/strong_type/difference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class conditionally_ordered::modifier<::strong::type<T, Tag, M...>>
}
};
}
struct difference
STRONG_TYPE_MODULE_EXPORT struct difference
{
template <typename T>
class modifier;
};

template <typename T, typename Tag, typename ... M>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... M>
class difference::modifier<::strong::type<T, Tag, M...>>
: public impl::conditionally_ordered::modifier<::strong::type<T, Tag, M...>>
, public equality::modifier<::strong::type<T, Tag, M...>>
Expand Down
4 changes: 2 additions & 2 deletions include/strong_type/equality.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
struct equality
STRONG_TYPE_MODULE_EXPORT struct equality
{
template <typename T, typename = void>
class modifier {
Expand All @@ -28,7 +28,7 @@ struct equality
};


template <typename T, typename Tag, typename ... M>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... M>
class equality::modifier<
::strong::type<T, Tag, M...>,
impl::void_t<decltype(std::declval<const T&>() == std::declval<const T&>())>
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/equality_with.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class typed_equality<
};
}

template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
struct equality_with
{
template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/formattable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
namespace strong
{

struct formattable
STRONG_TYPE_MODULE_EXPORT struct formattable
{
template <typename T>
class modifier{};
Expand Down
4 changes: 2 additions & 2 deletions include/strong_type/hashable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace strong
{
struct hashable
STRONG_TYPE_MODULE_EXPORT struct hashable
{
template <typename T>
class modifier{};
Expand All @@ -29,7 +29,7 @@ struct hashable
}

namespace std {
template<typename T, typename Tag, typename ... M>
STRONG_TYPE_MODULE_EXPORT template<typename T, typename Tag, typename ... M>
struct hash<::strong::type<T, Tag, M...>>
: std::conditional_t<
std::is_base_of<
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/implicitly_convertible_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct implicit_converter<
};
}

template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
struct implicitly_convertible_to
{
template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/incrementable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "type.hpp"

namespace strong {
struct incrementable
STRONG_TYPE_MODULE_EXPORT struct incrementable
{
template <typename T, typename = void>
class modifier
Expand Down
6 changes: 3 additions & 3 deletions include/strong_type/indexed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace strong
{
template <typename I = void>
STRONG_TYPE_MODULE_EXPORT template <typename I = void>
struct indexed
{
template <typename T, typename = void>
Expand All @@ -29,7 +29,7 @@ struct indexed
};
};

template <>
STRONG_TYPE_MODULE_EXPORT template <>
struct indexed<void> {
template<typename>
class modifier;
Expand Down Expand Up @@ -112,7 +112,7 @@ struct indexed<void> {
};
};

template <typename I>
STRONG_TYPE_MODULE_EXPORT template <typename I>
template <typename T, typename Tag, typename ... M>
class indexed<I>::modifier<
type<T, Tag, M...>,
Expand Down
4 changes: 2 additions & 2 deletions include/strong_type/invocable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
namespace strong
{

struct invocable
STRONG_TYPE_MODULE_EXPORT struct invocable
{
template <typename>
class modifier;
};

template <typename T, typename Tag, typename ... Ms>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... Ms>
class invocable::modifier<type<T, Tag, Ms...>>
{
using type = strong::type<T, Tag, Ms...>;
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/iostreamable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace strong
{
struct iostreamable
STRONG_TYPE_MODULE_EXPORT struct iostreamable
{
template <typename T>
class modifier
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/istreamable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace strong
{
struct istreamable
STRONG_TYPE_MODULE_EXPORT struct istreamable
{
template <typename T, typename = void>
class modifier
Expand Down
2 changes: 1 addition & 1 deletion include/strong_type/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace internal {

};
}
class iterator
STRONG_TYPE_MODULE_EXPORT class iterator
{
public:
template <typename I,
Expand Down
12 changes: 6 additions & 6 deletions include/strong_type/ordered.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif
namespace strong
{
struct ordered
STRONG_TYPE_MODULE_EXPORT struct ordered
{
template <typename T, typename = void>
class modifier
Expand All @@ -31,7 +31,7 @@ struct ordered
};
};


STRONG_TYPE_MODULE_EXPORT
template <typename T, typename Tag, typename ... M>
class ordered::modifier<
::strong::type<T, Tag, M...>,
Expand Down Expand Up @@ -108,7 +108,7 @@ struct spaceship_ordering {
struct modifier;
};

template<typename Ordering>
STRONG_TYPE_MODULE_EXPORT template<typename Ordering>
template<typename T, typename Tag, typename ... Ms>
struct spaceship_ordering<Ordering>::modifier<::strong::type<T, Tag, Ms...>>
{
Expand All @@ -131,9 +131,9 @@ struct spaceship_ordering<Ordering>::modifier<::strong::type<T, Tag, Ms...>>

}

using strongly_ordered = detail::spaceship_ordering<std::strong_ordering>;
using weakly_ordered = detail::spaceship_ordering<std::weak_ordering>;
using partially_ordered = detail::spaceship_ordering<std::partial_ordering>;
STRONG_TYPE_MODULE_EXPORT using strongly_ordered = detail::spaceship_ordering<std::strong_ordering>;
STRONG_TYPE_MODULE_EXPORT using weakly_ordered = detail::spaceship_ordering<std::weak_ordering>;
STRONG_TYPE_MODULE_EXPORT using partially_ordered = detail::spaceship_ordering<std::partial_ordering>;

#endif

Expand Down
8 changes: 4 additions & 4 deletions include/strong_type/ordered_with.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class typed_ordering<
};
}

template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
struct ordered_with
{
template <typename T>
Expand Down Expand Up @@ -171,11 +171,11 @@ struct spaceship_ordering_with

}

template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
using strongly_ordered_with = detail::spaceship_ordering_with<std::strong_ordering, Ts...>;
template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
using weakly_ordered_with = detail::spaceship_ordering_with<std::weak_ordering, Ts...>;
template <typename ... Ts>
STRONG_TYPE_MODULE_EXPORT template <typename ... Ts>
using partially_ordered_with = detail::spaceship_ordering_with<std::partial_ordering, Ts...>;

#endif
Expand Down
4 changes: 2 additions & 2 deletions include/strong_type/ostreamable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace strong
{
struct ostreamable
STRONG_TYPE_MODULE_EXPORT struct ostreamable
{
template <typename T, typename = void>
class modifier
Expand All @@ -43,7 +43,7 @@ struct ostreamable
};
};

template<typename T>
STRONG_TYPE_MODULE_EXPORT template<typename T>
using is_ostreamable = std::is_base_of<ostreamable::modifier<T>, T>;

}
Expand Down
6 changes: 3 additions & 3 deletions include/strong_type/pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@

namespace strong
{
struct pointer
STRONG_TYPE_MODULE_EXPORT struct pointer
{
template <typename T, typename = void>
class modifier;
};

template <typename T>
STRONG_TYPE_MODULE_EXPORT template <typename T>
class pointer::modifier<T, void>
{
static_assert(impl::always_false<T>, "Underlying type must support dereferencing with operator*");
};

template <typename T, typename Tag, typename ... M>
STRONG_TYPE_MODULE_EXPORT template <typename T, typename Tag, typename ... M>
class pointer::modifier<::strong::type<T, Tag, M...>, impl::void_t<decltype(*std::declval<T>())>>
{
using type = strong::type<T, Tag, M...>;
Expand Down
Loading