public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* std::unary_function is still present in C++17
@ 2019-11-11 10:20 Fredrik Hellman
  2019-11-11 11:36 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Fredrik Hellman @ 2019-11-11 10:20 UTC (permalink / raw)
  To: libstdc++

Hi,

I am surprised to see that std::unary_function is still defined when
including "functional" and compiling for C++17. It appears to be defined in
bits/stl_function.h where it is defined regardless of C++ version.

This gives me a bit of portability problems, since I get no indication from
the library that it is removed and might not compile on other platforms.
For instance, the class has been removed in MSVC.

Is there some way for me to keep the compiler/library to stick more
pedantically to the standard?

Best regards,
Fredrik Hellman

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: std::unary_function is still present in C++17
  2019-11-11 10:20 std::unary_function is still present in C++17 Fredrik Hellman
@ 2019-11-11 11:36 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2019-11-11 11:36 UTC (permalink / raw)
  To: fredrik.hellman; +Cc: libstdc++

On Mon, 11 Nov 2019 at 10:20, Fredrik Hellman wrote:
>
> Hi,
>
> I am surprised to see that std::unary_function is still defined when
> including "functional" and compiling for C++17. It appears to be defined in
> bits/stl_function.h where it is defined regardless of C++ version.

Yes, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91260

> This gives me a bit of portability problems, since I get no indication from
> the library that it is removed and might not compile on other platforms.
> For instance, the class has been removed in MSVC.
>
> Is there some way for me to keep the compiler/library to stick more
> pedantically to the standard?

Pedantically speaking, the standard allows us to define them. It also
allows us to remove them.

It's not a goal of libstdc++ to be a conformance checker to ensure
your code is portable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-11 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 10:20 std::unary_function is still present in C++17 Fredrik Hellman
2019-11-11 11:36 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).