From c563bf2c883284a1fa52de3de37ad3c19f42e4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C4=B0rsoy?= Date: Sat, 7 Dec 2024 19:10:29 -0500 Subject: [PATCH] Fix multiple definition errors (#94) --- barkeep/barkeep.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/barkeep/barkeep.h b/barkeep/barkeep.h index 5cb85ed..3eabedc 100644 --- a/barkeep/barkeep.h +++ b/barkeep/barkeep.h @@ -365,7 +365,7 @@ struct AnimationConfig { bool show = true; ///< show the animation immediately after construction }; -Duration as_duration(std::variant interval) { +inline Duration as_duration(std::variant interval) { if (std::holds_alternative(interval)) { return std::get(interval); } else { @@ -421,7 +421,7 @@ class AnimationDisplay : public BaseDisplay { /// Convenience factory function to create a shared_ptr to AnimationDisplay. /// Prefer this to constructing AnimationDisplay directly. -auto Animation(const AnimationConfig& cfg = {}) { +inline auto Animation(const AnimationConfig& cfg = {}) { return std::make_shared(cfg); } @@ -468,7 +468,7 @@ class StatusDisplay : public AnimationDisplay { /// Convenience factory function to create a shared_ptr to StatusDisplay. /// Prefer this to constructing StatusDisplay directly. -auto Status(const AnimationConfig& cfg = {}) { +inline auto Status(const AnimationConfig& cfg = {}) { return std::make_shared(cfg); } @@ -1032,13 +1032,13 @@ class CompositeDisplay : public BaseDisplay { /// Convenience factory function to create a shared_ptr to CompositeDisplay. /// Prefer this to constructing CompositeDisplay directly. -auto Composite(const std::vector>& displays, +inline auto Composite(const std::vector>& displays, std::string delim = " ") { return std::make_shared(displays, std::move(delim)); } /// Pipe operator can be used to combine two displays into a Composite. -auto operator|(std::shared_ptr left, +inline auto operator|(std::shared_ptr left, std::shared_ptr right) { return std::make_shared( std::vector{std::move(left), std::move(right)});