public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [GSoC] Question about Relatively Simple Library Traits
@ 2023-03-24  6:57 Ken Matsui
  2023-03-24  9:58 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Matsui @ 2023-03-24  6:57 UTC (permalink / raw)
  To: gcc

Hi,

I am working on the GSoC project, "C++: Implement compiler built-in
traits for the standard library traits". I found the following library
traits that I am not sure if implementing built-in traits brings
reasonable speed up.

* std::is_fundamental
* std::is_arithmetic
* std::is_scalar
* std::is_object
* std::is_compound
* std::is_scoped_enum

For example, std::is_object has no template specializations, but its
inheriting class looks complicated.

__not_<__or_<is_function<_Tp>, is_reference<_Tp>, is_void<_Tp>>>::type

If we define the built-in trait for this trait, we have: (as
equivalence of the above code)

__bool_constant<__is_object(_Tp)>

And __is_object built-in trait should be like:

!(type1 == FUNCTION_TYPE || type1 == ...)

In this case, could someone tell me which one would be faster? Or, is
there no other way to know which but to benchmark?

Sincerely,
Ken Matsui

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

end of thread, other threads:[~2023-03-24 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24  6:57 [GSoC] Question about Relatively Simple Library Traits Ken Matsui
2023-03-24  9:58 ` Jonathan Wakely
2023-03-24 10:05   ` Jonathan Wakely
2023-03-24 10:41     ` Ken Matsui

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).