[class.conv.general]

# 11 Classes [[class]](./#class)

## 11.4 Class members [[class.mem]](class.mem#class.conv.general)

### 11.4.8 Conversions [[class.conv]](class.conv#general)

#### 11.4.8.1 General [class.conv.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L2441)

Type conversions of class objects can be specified by constructors and
by conversion functions[.](#1.sentence-1)

These conversions are called[*user-defined conversions*](#def:conversion,user-defined "11.4.8.1 General [class.conv.general]") and are used for implicit type conversions ([[conv]](conv "7.3 Standard conversions")),
for initialization ([[dcl.init]](dcl.init "9.5 Initializers")),
and for explicit type conversions ([[expr.type.conv]](expr.type.conv "7.6.1.4 Explicit type conversion (functional notation)"), [[expr.cast]](expr.cast "7.6.3 Explicit type conversion (cast notation)"), [[expr.static.cast]](expr.static.cast "7.6.1.9 Static cast"))[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L2455)

User-defined conversions are applied only where they are unambiguous ([[class.member.lookup]](class.member.lookup "6.5.2 Member name lookup"), [[class.conv.fct]](class.conv.fct "11.4.8.3 Conversion functions"))[.](#2.sentence-1)

Conversions obey the access control rules ([[class.access]](class.access "11.8 Member access control"))[.](#2.sentence-2)

Access control is applied after ambiguity resolution ([[basic.lookup]](basic.lookup "6.5 Name lookup"))[.](#2.sentence-3)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L2460)

[*Note [1](#note-1)*:

See [[over.match]](over.match "12.2 Overload resolution") for a discussion of the use of conversions in function calls[.](#3.sentence-1)

â *end note*]

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L2465)

At most one user-defined conversion (constructor or conversion function)
is implicitly applied to a single value[.](#4.sentence-1)

[*Example [1](#example-1)*: struct X {operator int();};

struct Y {operator X();};

Y a;int b = a; // error: no viable conversion (a.operator X().operator int() not considered)int c = X(a); // OK, a.operator X().operator int() â *end example*]
