Std :: map :: emplace () missing - outdated libraries?

I am trying to use the emplace () function of C ++ 11 for a map, but NetBeans says there is no such function on the map. Looking at the headlines, this is β€œcorrect” - there is no mention (on Fedora 16) of emplace (). That everything is good and good, you know ... but I kind of want to use emplace ().

How do I enable this feature? I know that it existed from last March, perhaps earlier. A thorough search reveals that emplace () basically only exists on my system in list and vector headers. Since there has not been a large C ++ revision for almost a decade, I have not been able to find documentation on what to do if the libraries are "wrong."

+7
source share
2 answers

If your implementation does not support anything, you have two options:

  • do not use function
  • use another implementation that supports what you need.

The fact that there is a new standard does not expand the choice. In fact, it reduces it, since you will have additional difficulties in finding an implementation that supports everything you want for each goal.

Note that for things with a clean library, another implementation may be the one you do: wrapper compatibility has an increased appearance during transition. But you should pay attention to the effects of name collisions (the appearance of compatible shells can add ambiguity to the code when the function appears in its standard place).

+2
source

GCC 4.7 does not support this, because at that time there were unsolved problems with the standard. It is implemented in 4.8 and higher. You will need -std = C ++ 11

+1
source

All Articles