File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,12 @@ namespace curl {
74
74
* The two parameters constructor gives users a fast way to
75
75
* build an object of this type.
76
76
*/
77
- curl_pair (const CURLformoption option, const std::string &value) : option(option), value(value) {}
77
+ curl_pair (const CURLformoption option, const std::string &value) : option(option), value(value.c_str()) {}
78
+ /* *
79
+ * Alternate constructor that handles string constants without
80
+ * referencing temporary objects.
81
+ */
82
+ curl_pair (const CURLformoption option, const char *value) : option(option), value(value) {}
78
83
/* *
79
84
* Simple method that returns the first field of the pair.
80
85
*/
@@ -86,11 +91,11 @@ namespace curl {
86
91
* a C string, so a const char *.
87
92
*/
88
93
inline const char *second () const NOEXCEPT {
89
- return this ->value . c_str () ;
94
+ return this ->value ;
90
95
}
91
96
private:
92
97
const CURLformoption option;
93
- const std::string & value;
98
+ const char * value;
94
99
};
95
100
96
101
/* *
You can’t perform that action at this time.
0 commit comments