
Robert Ramey
a) always the right thing b) always the same thing - and maybe emit a warning or error when its not a good idea
Choosing b) makes for a transparent system and this is what I usually prefer. Generally I detest hidden features, attributes, which make things look easier but in fact produce surprising side-effects. When tthings fail it means a huge effort trying to get to the bottom of things - often the only recourse is by trial and error.
a) is much more popular today. It seems easier and makes a better demo. And its seductive - let's design it so "it just works". If there is one program > in my whole life which has tested my sanity its Microsoft Word. (next in line might be bjam).
snip rest. I understand this. But maybe the ambition is too high. In the c++ language one can choose many constructs, but the intention is not specified. For refernces it is clear (they must point to other objects), but (shared-)pointers can have value or reference semantics. An alternatvie would be too make a two layer library: in the basic library the user has to specify the storage intention himself; the upper layer uses the basic layer and try to make assumptions about intentions. In this way the user can alwyas fall back. For example in Boost.Bind one can explicitly specify the return type, it automatic detection is unsatisfying. This is of course all said without the experience of making a serialization library myself...