nonius icon indicating copy to clipboard operation
nonius copied to clipboard

Build failed with gcc4.9.3

Open claravu opened this issue 9 years ago • 2 comments

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!

claravu avatar Sep 14 '16 19:09 claravu

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 avatar Feb 12 '17 19:02 georgi-d

I changed the line from:

auto ss = std::stringstream{s}

to

std::stringstream ss{s}

And it compiles correctly.

georgi-d avatar Feb 12 '17 20:02 georgi-d