c++ - std::bind compiler error gcc -


in 1 of recent projects, did development work on ubuntu (cmake+gcc 4.8.4). code builds fine. however, when attempt build same code in cygwin (cmake + gcc 5.3), compiler error std::bind. goes away on doing #include <functional>. however, worries me little bit. expect code work fine on identical or similar compilers.

i have shipped out piece of code used on centos. assumed because code builds fine ubuntu, other linux distributions similar compiler should not problem. however, no longer sure if code build fine on centos.

my question this. can assume if code builds fine particular version of gcc on ubuntu machine, build fine on other linux distributions same or higher version of gcc? or being overly optimistic , should rely more testing? or has std::bind itself?

there no guarantee gcc compiler versions behave same. in particular w.r.t. c++ 11 features there incompatible changes between compiler versions. gcc 4.8 had still experimental c++ 11 support. standard says std::bind comes <functional>, gcc 5.3 correctly demands include it: http://en.cppreference.com/w/cpp/utility/functional/bind

it possible older versions of gcc either included <functional> in other include have, or bind provided in include.

it idea test software on different compiler versions , different compiler (like clang). otherwise might use extensions or small deviations c++ standard without knowing , tied particular compiler version.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -