# Solved: C++ colon operator??



## burnthepc (Aug 12, 2007)

I'm just reading some HLSL code and have run into this:


```
struct VertexShaderInput
{
    float4 Position : POSITION0;
}
```
The " float4 Position : POSITION0;" bit is confusing me. I know in constructors you can use the colon operator in the field initialisation list. This could be similar...initalising the vairiable using the colon operator.

Is that what it's doing?

If so then this would also be valid?


```
int x : 4;
// one constructor call
int x = 4;
// 2 constructor calls (possibly) + 1 assignment
```


----------



## burnthepc (Aug 12, 2007)

Read a little more and it's part of the syntax for that type of code.

On a side note. Is there a C++ standard use for the : operator? (apart from the a < b ? a :b and the field initialiser lists)


----------

