mirror of
https://github.com/boostorg/openmethod.git
synced 2026-01-22 05:22:26 +00:00
29 lines
628 B
C++
29 lines
628 B
C++
// Copyright (c) 2018-2025 Jean-Louis Leroy
|
|
// Distributed under the Boost Software License, Version 1.0. (See
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#ifndef ANIMALS_DEFINED
|
|
#define ANIMALS_DEFINED
|
|
|
|
// clang-format off
|
|
|
|
// tag::content[]
|
|
// animals.hpp
|
|
|
|
#include <string>
|
|
#include <boost/openmethod.hpp>
|
|
|
|
struct Animal { virtual ~Animal() {} };
|
|
struct Herbivore : Animal {};
|
|
struct Carnivore : Animal {};
|
|
|
|
BOOST_OPENMETHOD(
|
|
meet, (
|
|
boost::openmethod::virtual_ptr<Animal>,
|
|
boost::openmethod::virtual_ptr<Animal>),
|
|
std::string);
|
|
// end::content[]
|
|
|
|
#endif
|