| 1234567891011121314151617181920212223242526272829 |
- //
- // die.hpp
- // dice-roll
- //
- // Created by Sam Jaffe on 12/1/18.
- // Copyright © 2018 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <boost/variant/variant.hpp>
- #include <iosfwd>
- #include <memory>
- namespace dice {
- struct dice;
- using sub_dice = boost::variant<int, std::shared_ptr<dice>>;
-
- // Default value: 1d1+0
- struct dice {
- int num{1};
- sub_dice of{1};
- sub_dice modifier{+0};
- };
-
- std::ostream & operator<<(std::ostream & out, dice const & d);
- std::istream & operator>>(std::istream & out, dice & d);
- }
|