DigitalInBlue / Celero

C++ Benchmark Authoring Library/Framework
Other
824 stars 95 forks source link

Add missing #include <functional> #103

Closed mloskot closed 7 years ago

mloskot commented 7 years ago

Fix error: function is not a member of std when compiling with GCC 7.1.0.


Full compilation error

In file included from /mnt/f/dev/celero/src/Distribution.cpp:21:0:
/mnt/f/dev/celero/include/celero/Utilities.h:120:44: error: variable or field ‘DoNotOptimizeAway’ declared void
  CELERO_EXPORT void DoNotOptimizeAway(std::function<void(void)>&& x);
                                            ^~~~~~~~
/mnt/f/dev/celero/include/celero/Utilities.h:120:44: error: ‘function’ is not a member of ‘std’
/mnt/f/dev/celero/include/celero/Utilities.h:120:44: note: suggested alternative: ‘is_function’
  CELERO_EXPORT void DoNotOptimizeAway(std::function<void(void)>&& x);
                                            ^~~~~~~~
                                            is_function
/mnt/f/dev/celero/include/celero/Utilities.h:120:53: error: expected primary-expression before ‘void’
  CELERO_EXPORT void DoNotOptimizeAway(std::function<void(void)>&& x);
                                                     ^~~~
DigitalInBlue commented 7 years ago

Please do the pull request against the "develop" branch as per git-flow. Thank you for the maintenance.

mloskot commented 7 years ago

I've switched the base branch for this PR to develop.