ambiguous std::fill with character array

Maik Beckmann
Thu Mar 27 21:11:00 GMT 2008


Consider this snipped
#include <string>
#include <vector>
#include <algorithm>

int main() {
  std::vector<std::string> foo(20);  
  std::fill(foo.begin(), foo.end(), "bar");

g++-4.2.3 compiles it, but 4.3.0 gives the attached error message.  

The solution is to use
  std::fill(array.begin(), array.end(), std::string("interpolateboundary"));

My question: Is it a bug or by intention?

 -- Maik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log
Type: text/x-diff
Size: 1740 bytes
Desc: not available
URL: <>

More information about the Gcc-help mailing list