martinus / nanobench

Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20
https://nanobench.ankerl.com
MIT License
1.43k stars 82 forks source link

fix compilation error on msvc < 1928 #82

Closed toge closed 1 year ago

toge commented 1 year ago

Hi. I met compilation errors on msvc 1927. https://godbolt.org/z/9Ph4v674E

error C2610: 'ankerl::nanobench::Config::Config(ankerl::nanobench::Config &&) noexcept': 
is not a special member function or comparison operator which can be defaulted

It was caused by adding STL containers member to Config and Result since nanobench 7.3.8, because STL containers in msvc < 1928 seem not to have noexcept move constructor.

Simple reproduce code is following: https://godbolt.org/z/5YM7bMTrW

It works fine on msvc 1928. https://godbolt.org/z/YdThcWh3E

Please review my PR and merge it if possible. It works fine on msvc 1927. https://godbolt.org/z/K7TPhYzj8

martinus commented 1 year ago

Why do you need compatibility to 1927?