--- a/include/boxed-cpp/boxed.hpp
+++ b/include/boxed-cpp/boxed.hpp
@@ -219,7 +219,9 @@ struct std::formatter<boxed::detail::box
         return std::formatter<Type>::format(val.value, ctx);
     }
 };
-#elif __has_include(<fmt/format.h>)
+#endif
+
+#if __has_include(<fmt/format.h>)
 
 // clang-format off
 #include <fmt/format.h>
