boost::openmethod::virtual_traits<std::unique_ptr<Class>, Registry>
Specialize virtual_traits for std::unique_ptr by value.
Synopsis
Declared in <boost/openmethod/interop/std_unique_ptr.hpp>
template<
class Class,
class Registry>
struct virtual_traits<std::unique_ptr<Class>, Registry>;
Example
struct Animal {
virtual ~Animal() = default;
};
struct Dog : Animal {};
struct Cat : Animal {};
BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat);
BOOST_OPENMETHOD(poke, (virtual_<std::unique_ptr<Animal>>), std::string);
BOOST_OPENMETHOD_OVERRIDE(poke, (std::unique_ptr<Dog> animal), std::string) {
return "bark";
}
BOOST_OPENMETHOD_OVERRIDE(poke, (std::unique_ptr<Cat> animal), std::string) {
return "hiss";
}
Type Aliases
Name |
Description |
|
|
Rebind to a different element type. |
Template Parameters
Name |
Description |
Class |
A class type, possibly cv‐qualified. |
Registry |
A |
See Also
Created with MrDocs