C++17 feature proposal: Ban std::any

81 views
Skip to first unread message

Daniel Cheng

unread,
Jan 6, 2022, 4:09:23 PM1/6/22
to cxx
Similarly to absl::any, the no-RTTI implementation is incompatible with component builds: it uses the address of a static variable in a class that's templated on the type [1], but in a component build, different shared libraries will have their own copy of the static variable.

See https://crbug.com/1096380 for additional context.

Daniel

K. Moon

unread,
Jan 6, 2022, 4:18:04 PM1/6/22
to Daniel Cheng, cxx
+1

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKpKXN4PpzGHoQ4-KH5J-pgypNhO5muLk9-CWZv4gxxaLA%40mail.gmail.com.

Jeremy Roman

unread,
Jan 6, 2022, 4:22:55 PM1/6/22
to K. Moon, Daniel Cheng, cxx

Dan McArdle

unread,
Jan 6, 2022, 4:23:24 PM1/6/22
to K. Moon, Daniel Cheng, cxx
In case it needs to be said for anyone besides myself, note that std::any != std::any_of.

On Thu, Jan 6, 2022 at 4:18 PM K. Moon <km...@chromium.org> wrote:

Avi Drissman

unread,
Jan 6, 2022, 4:29:34 PM1/6/22
to Dan McArdle, K. Moon, Daniel Cheng, cxx
+1. Component builds are far more important.

Peter Kasting

unread,
Jan 6, 2022, 4:39:44 PM1/6/22
to Daniel Cheng, cxx
+1

PK

--
Reply all
Reply to author
Forward
0 new messages