New revision of P0194

140 views
Skip to first unread message

Anton Bikineev

unread,
Feb 13, 2017, 1:04:02 PM2/13/17
to SG 7 - Reflection
Hi SG7,

I just read a new revision of P0194 and have a few questions regarding the changes:
  • why was _m suffix renamed back to _t? I found it more consistent and clarifying that returned type is at meta-level. It might be confusing with
    get_reflected_type_t, which returns a "real" type;
  • why was syntax of reflexpr and friends changed to $*?
  • template <template <class...> class Tpl, ObjectSequence S>
    constexpr auto unpack_sequence_v = unpack_sequence<Tpl, S>::value;
    Does unpack_sequence return ::value now? or is it just a typo?
  • P0194 explicitly states that empty $reflect is ill-formed, but updated examples in P0385 still use it.

Thanks in advance!


Sincerely,

Anton

Axel Naumann

unread,
Feb 14, 2017, 5:04:03 AM2/14/17
to refle...@isocpp.org
Hi Anton,

Thanks for your comments!

On 02/13/2017 07:04 PM, Anton Bikineev wrote:
Hi SG7,

I just read a new revision of P0194 and have a few questions regarding the changes:
  • why was _m suffix renamed back to _t? I found it more consistent and clarifying that returned type is at meta-level. It might be confusing with
    get_reflected_type_t, which returns a "real" type;
The other authors found it confusing given that it should have a ::type member for meta-programming consistency.
  • why was syntax of reflexpr and friends changed to $*?
reflexpr is hard to pronounce etc - as are all alternative keywords that have a low probability of being used already in existing code.

Extending the character set allows us to use more keywords on the reflection level later (we will need them, think unreflect and identifier generation), without the danger of clashing with existing code and without having to come up with cryptic keywords to avoid those clashes.

  • template <template <class...> class Tpl, ObjectSequence S> constexpr auto unpack_sequence_v = unpack_sequence<Tpl, S>::value;
    Does unpack_sequence return ::value now? or is it just a typo?
Typo, thanks for catching!
  • P0194 explicitly states that empty $reflect is ill-formed, but updated examples in P0385 still use it.
That's a bug, too (in p0385) - thanks! Rationale for the change: we might introduce $reflect() as "reflect the current scope", later.

Axel.

--
ROOT - http://root.cern
EP-SFT, CERN, 1211 Geneve 23, Switzerland
Tel: +41 22 7678225

Matus Chochlik

unread,
Feb 14, 2017, 1:46:46 PM2/14/17
to refle...@isocpp.org
The only occurrence of `$reflect()` is in section 6.6 where we're discussing possible syntax for a planned feature -- context dependent reflection -- which is why we made `$reflect()` ill-formed for the moment.

--Matus

Anton Bikineev

unread,
Feb 15, 2017, 1:53:15 AM2/15/17
to SG 7 - Reflection
Axel,

Thanks for clarification!

Matus,

Sorry, my bad, it seems I confused tabs in my browser :)

Sincerely,
Anton.

среда, 15 февраля 2017 г., 1:46:46 UTC+7 пользователь Matúš Chochlík написал:

Anton Bikineev

unread,
Feb 18, 2017, 12:07:11 AM2/18/17
to SG 7 - Reflection
One more problem is that p0385r2 doesn't update variable concepts to function concepts. The most ironic thing is that static_asserts with those concepts will always evalute to true as being function addresses.
Reply all
Reply to author
Forward
0 new messages