Discussion:
What does "Standard conversions will be used" mean?
(too old to reply)
Nicolas Lesser
2018-10-27 13:04:08 UTC
Permalink
- Standard conversions ([conv]) will be used, if necessary, to convert
the initializer expression to the cv-unqualified version of the destination
type; no user-defined conversions are considered.

What does the standard mean by "standard conversion will be used" here?

Is it:

1. Any standard conversion is allowed, in any order, no matter how many of
them.

or

2. a standard conversion sequence.

Pretty sure it's 2), but the sentence is a bit unclear to me, as it doesn't
say which ones get used.

Thanks! :)
- Nicolas
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
Richard Smith
2018-10-28 19:13:35 UTC
Permalink
Post by Nicolas Lesser
- Standard conversions ([conv]) will be used, if necessary, to convert
the initializer expression to the cv-unqualified version of the destination
type; no user-defined conversions are considered.
What does the standard mean by "standard conversion will be used" here?
1. Any standard conversion is allowed, in any order, no matter how many of
them.
or
2. a standard conversion sequence.
Pretty sure it's 2), but the sentence is a bit unclear to me, as it
doesn't say which ones get used.
I think the wording here could do with some attention. We fairly strictly
use "implicit conversion sequence" to mean the fiction that overload
resolution imagines when considering viability and ranking of conversions,
and also use "standard conversion sequence" for that purpose. But the
wording in some places also suggests that a standard conversion sequence is
also used for actually applying conversions (and in other places, like this
one, we don't use that term).

In practice, I think it's mostly a difference without distinction -- except
that a sequence of standard conversions can contain a temporary
materialization conversion whereas a standard conversion sequence cannot...
and in fact we can presumably make an arbitrarily long sequence of standard
conversions by applying the temporary materialization conversion followed
by the lvalue-to-rvalue conversion. We probably do need some actual rules
here to specify what sequence of standard conversions to perform,
disallowing temporary materialization. The "if necessary" seems a bit too
vague.

Please file an editorial issue; we'll promote it to a core issue if we
don't think it can be suitably handled editorially.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
Nicolas Lesser
2018-10-28 19:39:57 UTC
Permalink
Filed: https://github.com/cplusplus/draft/issues/2374

Thanks! :)
Post by Richard Smith
Post by Nicolas Lesser
- Standard conversions ([conv]) will be used, if necessary, to convert
the initializer expression to the cv-unqualified version of the destination
type; no user-defined conversions are considered.
What does the standard mean by "standard conversion will be used" here?
1. Any standard conversion is allowed, in any order, no matter how many
of them.
or
2. a standard conversion sequence.
Pretty sure it's 2), but the sentence is a bit unclear to me, as it
doesn't say which ones get used.
I think the wording here could do with some attention. We fairly strictly
use "implicit conversion sequence" to mean the fiction that overload
resolution imagines when considering viability and ranking of conversions,
and also use "standard conversion sequence" for that purpose. But the
wording in some places also suggests that a standard conversion sequence is
also used for actually applying conversions (and in other places, like this
one, we don't use that term).
In practice, I think it's mostly a difference without distinction --
except that a sequence of standard conversions can contain a temporary
materialization conversion whereas a standard conversion sequence cannot...
and in fact we can presumably make an arbitrarily long sequence of standard
conversions by applying the temporary materialization conversion followed
by the lvalue-to-rvalue conversion. We probably do need some actual rules
here to specify what sequence of standard conversions to perform,
disallowing temporary materialization. The "if necessary" seems a bit too
vague.
Please file an editorial issue; we'll promote it to a core issue if we
don't think it can be suitably handled editorially.
--
---
You received this message because you are subscribed to the Google Groups
"ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at
https://groups.google.com/a/isocpp.org/group/std-discussion/.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
Continue reading on narkive:
Loading...