82 {
83
84 auto *sp =
86 if (sp != nullptr && sp->constraint_ok(constraint)) {
87 sp->set_value(value);
88 }
89 if (*value == '\0') {
90 return (sp != nullptr);
91 }
92
93
95 if (ip && ip->constraint_ok(constraint)) {
96 int intval = INT_MIN;
97 std::stringstream stream(value);
98 stream.imbue(std::locale::classic());
99 stream >> intval;
100 if (intval != INT_MIN) {
101 ip->set_value(intval);
102 }
103 }
104
105
107 if (bp != nullptr && bp->constraint_ok(constraint)) {
108 if (*value == 'T' || *value == 't' || *value == 'Y' || *value == 'y' || *value == '1') {
109 bp->set_value(true);
110 } else if (*value == 'F' || *value == 'f' || *value == 'N' || *value == 'n' || *value == '0') {
111 bp->set_value(false);
112 }
113 }
114
115
116 auto *dp =
118 if (dp != nullptr && dp->constraint_ok(constraint)) {
119 double doubleval = NAN;
120 std::stringstream stream(value);
121 stream.imbue(std::locale::classic());
122 stream >> doubleval;
123 if (!std::isnan(doubleval)) {
124 dp->set_value(doubleval);
125 }
126 }
127 return (sp || ip || bp || dp);
128}