Files
2025-10-05 19:15:54 -04:00

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