-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove conversion.hpp dependency from public headers #12665
Conversation
Hmm, I don't think this is going to work. I'll revert #12414 while we figure out what to do to fix the build |
d345f16
to
1f9ecee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see how this is intended to work now. Thanks for fixing the build.
template optional<PropertyValue<TextTransformType>> Converter<PropertyValue<TextTransformType>>::operator()(conversion::Convertible const&, conversion::Error&, bool, bool) const; | ||
template optional<PropertyValue<TranslateAnchorType>> Converter<PropertyValue<TranslateAnchorType>>::operator()(conversion::Convertible const&, conversion::Error&, bool, bool) const; | ||
|
||
// template optional<PropertyValue<AlignmentType>> convert<PropertyValue<AlignmentType>, bool, bool>(const Convertible&, Error&, bool&&, bool&&); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
return PropertyExpression<T>(std::move(*expression), defaultValue); | ||
} | ||
|
||
template optional<PropertyExpression<AlignmentType>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty tempting to use a macro here:
#define EXPLICIT_INSTANTIATION(T) template optional<PropertyExpression<T>> \
convertFunctionToExpression<T>(const Convertible&, Error&, bool);
EXPLICIT_INSTANTIATION(AlignmentType);
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refrained from adding this because it's tricky to get complex typenames (e.g. std::array<float, 2>
) to work correctly in a macro context. You could probably swing something with __VA_ARGS__
, but that's nonstandard.
struct Error { std::string message; }; | ||
|
||
template <typename T> | ||
class ConversionTraits; | ||
|
||
class Convertible { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here explaining that this is a minimal header suitable for obtaining forward declarations, and that implementation files that need to actually perform conversions should include conversion_impl.hpp
.
1f9ecee
to
cc2ab68
Compare
Moves the template definition to a _impl.hpp header file in
src
.