mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-10 14:23:00 +03:00
Fix use of std::vector in optional C++ interface (see #262)
This commit is contained in:
@@ -251,11 +251,16 @@ class FooHandler : public CivetHandler
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
const char *options[] = {
|
||||
"document_root", DOCUMENT_ROOT, "listening_ports", PORT, 0};
|
||||
|
||||
std::vector<std::string> cpp_options;
|
||||
for (int i=0; i<(sizeof(options)/sizeof(options[0])-1); i++) {
|
||||
cpp_options.push_back(options[i]);
|
||||
}
|
||||
|
||||
CivetServer server(options);
|
||||
// CivetServer server(options); // <-- C style start
|
||||
CivetServer server(cpp_options); // <-- C++ style start
|
||||
|
||||
ExampleHandler h_ex;
|
||||
server.addHandler(EXAMPLE_URI, h_ex);
|
||||
|
Reference in New Issue
Block a user