Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

These appear to be distinct definitions for the term explicit type conversion, as highlighted below. #4085

Open
jabelloc opened this issue Jul 19, 2020 · 0 comments

Comments

@jabelloc
Copy link

An explicit type conversion ([expr.type.conv], [expr.cast]) is interpreted as a sequence of elementary casts, covered above.

an explicit type conversion ([expr.type.conv], [expr.static.cast], [expr.cast]) that constructs an object through a constructor declared nodiscard in a reachable declaration, or that initializes an object of a nodiscard type.

Type conversions of class objects can be specified by constructors and by conversion functions. These conversions are called user-defined conversions and are used for implicit type conversions ([conv]), for initialization ([dcl.init]), and for explicit type conversions ([expr.type.conv], [expr.cast], [expr.static.cast]).

[Note: An abstract class type cannot be used as a parameter or return type of a function being defined ([dcl.fct]) or called ([expr.call]), except as specified in [dcl.type.simple]. Further, an abstract class type cannot be used as the type of an explicit type conversion ([expr.static.cast], [expr.reinterpret.cast], [expr.const.cast]), because the resulting prvalue would be of abstract class type ([basic.lval]). However, pointers and references to abstract class types can appear in such contexts. — end note]

an explicit type conversion ([expr.type.conv], [expr.static.cast], [expr.cast]), or

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant