[libcxx-commits] [libcxx] [libc++] Adds a global private constructor tag. (PR #87920)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 9 09:47:18 PDT 2024
================
@@ -35,9 +36,8 @@ namespace chrono {
class leap_second {
public:
- struct __constructor_tag;
[[nodiscard]]
- _LIBCPP_HIDE_FROM_ABI explicit constexpr leap_second(__constructor_tag&&, sys_seconds __date, seconds __value)
+ _LIBCPP_HIDE_FROM_ABI explicit constexpr leap_second(__private_constructor_tag&&, sys_seconds __date, seconds __value)
----------------
ldionne wrote:
I would actually take this argument by value since it's a trivial type.
I think that technically, if the function is not inlined, then passing a rvalue reference would be worse for codegen because you'd have to actually pass the address of something, whereas you wouldn't if you're passing this trivial empty struct by value. For example: https://godbolt.org/z/dbe4zPb8K
https://github.com/llvm/llvm-project/pull/87920
More information about the libcxx-commits
mailing list