libnonius / nonius

A C++ micro-benchmarking framework
https://nonius.io
Creative Commons Zero v1.0 Universal
358 stars 47 forks source link

Build failed with gcc4.9.3 #76

Open claravu opened 7 years ago

claravu commented 7 years ago

Compiling a tiny test project consisting only of example1.c++, I get the following error:

In file included from /home/claravu/nonius/include/nonius/configuration.h++:17:0, from /home/claravu/nonius/include/nonius/benchmark.h++:18, from /home/claravu/nonius/include/nonius/nonius.h++:18, from /home/claravu/nonius/include/nonius/nonius_single.h++:14, from /home/claravu/test_nonius/example1.c++:36: /home/claravu/nonius/include/nonius/param.h++: In member function ‘nonius::param nonius::param::parse(const string&) const’: /home/claravu/nonius/include/nonius/param.h++:103:38: error: use of deleted function ‘std::basic_stringstream::basic_stringstream(const std::basic_stringstream&)’ auto ss = std::stringstream{s};

Changing the offending line to:

  std::stringstream ss;
  ss.str(s);

Made the error go away, but I'm not 100% sure this it true to the intent. The error does not occur in v1.1.2.

I'm trying out nonius for benchmarking on a new project, looks pretty good so far!

georgi-d commented 7 years ago

The same error happens with gcc-4.8.4 as well as clang-3.9 with both std=c++11 and c++14

georgi-d commented 7 years ago

I changed the line from:

auto ss = std::stringstream{s}

to

std::stringstream ss{s}

And it compiles correctly.