File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -550,7 +550,13 @@ class ll_convert
550550public:
551551 ll_convert (const FROM& ref): mRef (ref) {}
552552
553- template <typename TO>
553+ inline operator const FROM&() const
554+ {
555+ return mRef ;
556+ }
557+
558+ template <typename TO,
559+ std::enable_if_t <! std::is_same_v<std::decay_t <TO>, std::decay_t <FROM>>, bool > =true >
554560 inline operator TO () const
555561 {
556562 return ll_convert_impl<TO, std::decay_t <const FROM>>()(mRef );
@@ -559,7 +565,15 @@ class ll_convert
559565
560566// When the TO type must be explicit, use a function template to get
561567// ll_convert_to<TO>(from_value) API.
562- template <typename TO, typename FROM>
568+ template <typename SAME>
569+ const SAME& ll_convert_to (const SAME& in)
570+ {
571+ return in;
572+ }
573+
574+ template <typename TO,
575+ typename FROM,
576+ std::enable_if_t <! std::is_same_v<std::decay_t <TO>, std::decay_t <FROM>>, bool > =true >
563577TO ll_convert_to (const FROM& in)
564578{
565579 return ll_convert_impl<TO, std::decay_t <const FROM>>()(in);
You can’t perform that action at this time.
0 commit comments