Skip to content

Commit 1aec0f0

Browse files
committed
Fix build error bad concepts
1 parent b4ecebe commit 1aec0f0

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

lib/include/elements/element/label.hpp

+40-28
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,24 @@ namespace cycfi::elements
274274
*
275275
* @tparam Subject
276276
* The Subject of the label that must fulfill the `Element` concept.
277+
*
277278
* @tparam T
278279
* The type of value that is converted to the label's text.
280+
*
279281
* @tparam F
280282
* The type of user-defined function that is used for conversion of the
281283
* value into text.
282284
*/
283-
template <concepts::LabelStyler Label, typename T, typename F>
284-
class as_label_element : public receiver<T>, public proxy<Label>
285+
template <concepts::Element Subject, typename T, typename F>
286+
class as_label_element : public receiver<T>, public proxy<Subject>
285287
{
286288
public:
287289

288-
using base_type = proxy<Label>;
290+
using base_type = proxy<Subject>;
289291
using param_type = typename receiver<T>::param_type;
290292
using getter_type = typename receiver<T>::getter_type;
291293

292-
as_label_element(F&& as_string, Label label);
294+
as_label_element(F&& as_string, Subject label);
293295

294296
void value(param_type val) override;
295297
getter_type value() const override;
@@ -300,9 +302,9 @@ namespace cycfi::elements
300302
T _value;
301303
};
302304

303-
template <typename T, concepts::LabelStyler Label, typename F>
304-
inline as_label_element<remove_cvref_t<Label>, T, remove_cvref_t<F>>
305-
as_label(F&& as_string, Label&& label);
305+
template <typename T, concepts::Element Subject, typename F>
306+
inline as_label_element<remove_cvref_t<Subject>, T, remove_cvref_t<F>>
307+
as_label(F&& as_string, Subject&& subject);
306308

307309
////////////////////////////////////////////////////////////////////////////
308310
// Inlines
@@ -532,8 +534,8 @@ namespace cycfi::elements
532534
/**
533535
* @brief Construct a new `as_label_element`.
534536
*
535-
* @tparam Label
536-
* A type that fulfills the `LabelStyler` concept.
537+
* @tparam Subject
538+
* A type that fulfills the `Element` concept.
537539
*
538540
* @tparam T
539541
* The type of value that is converted to the label's text.
@@ -545,13 +547,13 @@ namespace cycfi::elements
545547
* @param as_string
546548
* The function to convert the value into the label's text.
547549
*
548-
* @param label
549-
* The label.
550+
* @param subject
551+
* The subject.
550552
*/
551-
template <concepts::LabelStyler Label, typename T, typename F>
552-
inline as_label_element<Label, T, F>::as_label_element(F&& as_string, Label label)
553+
template <concepts::Element Subject, typename T, typename F>
554+
inline as_label_element<Subject, T, F>::as_label_element(F&& as_string, Subject subject)
553555
: _as_string(as_string)
554-
, base_type(std::move(label))
556+
, base_type(std::move(subject))
555557
{}
556558

557559
/**
@@ -571,8 +573,8 @@ namespace cycfi::elements
571573
* @param val
572574
* The value to be set.
573575
*/
574-
template <concepts::LabelStyler Label, typename T, typename F>
575-
inline void as_label_element<Label, T, F>::value(param_type val)
576+
template <concepts::Element Subject, typename T, typename F>
577+
inline void as_label_element<Subject, T, F>::value(param_type val)
576578
{
577579
_value = val;
578580
if (auto tw = find_subject<text_writer_u8*>(this))
@@ -583,12 +585,22 @@ namespace cycfi::elements
583585
* @brief
584586
* Get the value of the label.
585587
*
588+
* @tparam Subject
589+
* A type that fulfills the `Element` concept.
590+
*
591+
* @tparam T
592+
* The type of value that is converted to the label's text.
593+
*
594+
* @tparam F
595+
* The type of user-defined function that is used for conversion of the
596+
* value into text.
597+
*
586598
* @return
587599
* The value of the label.
588600
*/
589-
template <concepts::LabelStyler Label, typename T, typename F>
590-
inline typename as_label_element<Label, T, F>::getter_type
591-
as_label_element<Label, T, F>::value() const
601+
template <concepts::Element Subject, typename T, typename F>
602+
inline typename as_label_element<Subject, T, F>::getter_type
603+
as_label_element<Subject, T, F>::value() const
592604
{
593605
return _value;
594606
}
@@ -600,8 +612,8 @@ namespace cycfi::elements
600612
* @tparam T
601613
* The type of value that is converted to the label's text.
602614
*
603-
* @tparam Label
604-
* A type that fulfills the `LabelStyler` concept.
615+
* @tparam Subject
616+
* A type that fulfills the `Element` concept.
605617
*
606618
* @tparam F
607619
* The type of user-defined function that is used for conversion of the
@@ -610,18 +622,18 @@ namespace cycfi::elements
610622
* @param as_string
611623
* The function to convert the value into the label's text.
612624
*
613-
* @param label
614-
* The label.
625+
* @param subject
626+
* The subject.
615627
*
616628
* @return
617-
* A new `as_label_element` with the processed Subject and Function.
629+
* A new `as_label_element` given Subject and as_string Function.
618630
*/
619-
template <typename T, concepts::LabelStyler Label, typename F>
620-
inline as_label_element<remove_cvref_t<Label>, T, remove_cvref_t<F>>
621-
as_label(F&& as_string, Label&& label)
631+
template <typename T, concepts::Element Subject, typename F>
632+
inline as_label_element<remove_cvref_t<Subject>, T, remove_cvref_t<F>>
633+
as_label(F&& as_string, Subject&& subject)
622634
{
623635
using ftype = remove_cvref_t<F>;
624-
return {std::forward<ftype>(as_string), std::forward<Label>(label)};
636+
return {std::forward<ftype>(as_string), std::forward<Subject>(subject)};
625637
}
626638

627639
/**

0 commit comments

Comments
 (0)