This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Overloading vs. string functions, etc.
Mark Mitchell <mark@codesourcery.com> writes:
> >>>>> "Andreas" == Andreas Jaeger <aj@suse.de> writes:
>
> Andreas> So, what can glibc do and what should glibc not do under
> Andreas> C++ compilation (and please explain why, I'd like to
>
> I'm excited that you're willing to help with this.
>
> How about, on GNU/Linux, just making our lives easy? :-)
That's what I'm considering but since I'm no C++ expert, I need help
from the experts.;-)
> Make <string.h> contain:
>
> #ifdef __cplusplus
> namespace std {
> #endif
But this would break with GCC 2.95, wouldn't it? So it should be
(__GNUC_PREREQ just check that we use GCC with the supplied version):
#if defined __cplusplus && __GNUC_PREREQ (3,0)
namespace std {
#endif
...
#if defined __cplusplus && __GNUC_PREREQ (3,0)
}
#endif
> Also, add overloads for the variants of these functions that are not
> present in C? And make the functions inlines that call
> `__builtin_foo' under C++?
I'm not sure what you really mean here.
> In other words, how about just making the C headers be valid C++
> headers, too? This is Sun's approach, and it makes life much simpler
> for the rest of the C++ library.
I have to discuss this with the other glibc developers and this is
actually not yet implemented so might be too late for GCC 3.0.
> Does this make sense?
Not really, I'm not familiar enough with C++ library design.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj