Skip to content

Commit eb8e075

Browse files
authored
operator= for ofParameter<string> = "char" (#8235)
1 parent 6c53cfb commit eb8e075

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libs/openFrameworks/types/ofParameter.h

+7
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,13 @@ class ofParameter : public ofAbstractParameter {
589589
ofParameter<ParameterType> & operator=(const ofParameter<ParameterType> & v);
590590
const ParameterType & operator=(const ParameterType & v);
591591

592+
template <typename U = ParameterType>
593+
typename std::enable_if_t<std::is_same_v<U, std::string>, ofParameter&>
594+
operator=(const char* value) {
595+
set(std::string(value));
596+
return *this;
597+
}
598+
592599
ParameterType operator++(int v);
593600
ofParameter<ParameterType> & operator++();
594601

0 commit comments

Comments
 (0)