# Slow Chat Archives > Slow Chat: Visual C++: Yesterday, Today, and Tomorrow >  [RESOLVED] Why ref / value?

## ABuenger

Why were the ref / value keywords introduced? I don't see any value they add to the language, they only seem to unnecessary complicate things.

Why can't I inherit a value struct from an other value struct?


André

----------


## joncaves

The CLR has the concept of a reference type and a value-type and we need to expose these concepts in C++/CLI. A reference type lives on the garbage collected heap while a value-type lives on the stack. We did consider (for about 10ms) going the C# route abd having 'struct' mean a value-type but we very quickly decided that this would break too much C++ code.

As value-types are meant to represent small values and as the only live on the stack (if we ignore the thorny issue of boxing) then for performance reasons it makes sense not require that all value-types are sealed. The is a CLR requirment so if C++/CLI wants to run corectly on the CLR we need to follow their rules - and I for one think that this a rule that makes sense. If you find that you need to inherit from a value-type then the changes are that you should really be using a reference-type.

----------

