Overloading vs. string functions, etc.

scott snyder snyder@fnal.gov
Thu May 24 13:08:00 GMT 2001


Mark Mitchell <mark@codesourcery.com> writes:
> How about `#define strcpy __glibcpp_strcpy' in std_cstring.h before
> including /usr/includ/string.h?  I think that would do the trick.
> Thoughts?

Will that work if someone includes <string.h> directly, before <cstring>?

#include <string.h>
#include <cstring>
...


That's not unlikely to occur in practise, especially for the case where
<cstring> isn't included directly, but is pulled in by one of the
other C++ headers.

I'm not sure how to deal with that, other than providing a string.h
in libstdc++ that does the wrapping around the /usr/include/string.h
functions.

sss



More information about the Libstdc++ mailing list