For the record, here is our new stereotyped override for the Linked Attribute Declaration template and our new "shared" stereotype:
%PI=" "%
$type=%REPLACE(linkAttQualName,".","::")%
$qualType=%packagePath% + "::" + %linkAttName%
%if genOptCPPGenNamespace == "T" and $type == $qualType%
$type="boost::shared_ptr<"+%linkAttName%+">"
%endIf%
%if linkAttCollectionClass != "" and linkCard != "" and linkCard != "0" and linkCard != "0..1" and linkCard != "1"%
$type=%REPLACE(linkAttCollectionClass,"$TYPE",$type)%
%endIf%
$type
%if linkAttRole != ""%
%linkAttRole%;
%else%
%REPLACE(genOptDefaultAssocAttName,"$LinkClass",linkAttName)%;
%endIf%
This handles all the multiplicities, and integrates nicely with the collection classes, as long as you use $TYPE instead of #TYPE# in the collection class definition in the code generation options. So, we have smart pointers or, at our pleasure, containers of smart pointers. Just repeat for stereotypes "weak" and "scoped".