Skip to content

Commit

Permalink
Make print wrappers inline (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Mar 1, 2024
1 parent 7363e6e commit 0e346bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/autodiff/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include "sleipnir/autodiff/Variable.hpp"

#include <fmt/core.h>

#include "sleipnir/autodiff/Expression.hpp"
#include "sleipnir/autodiff/ExpressionGraph.hpp"
#include "util/Print.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/optimization/OptimizationProblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <array>
#include <iterator>

#include <fmt/core.h>

#include "optimization/solver/InteriorPoint.hpp"
#include "sleipnir/optimization/SolverExitCondition.hpp"
#include "util/Print.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/util/Print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace sleipnir {
* Wrapper around fmt::print() that squelches write failure exceptions.
*/
template <typename... T>
void print(fmt::format_string<T...> fmt, T&&... args) {
inline void print(fmt::format_string<T...> fmt, T&&... args) {
try {
fmt::print(fmt, std::forward<T>(args)...);
} catch (const std::system_error&) {
Expand All @@ -24,7 +24,7 @@ void print(fmt::format_string<T...> fmt, T&&... args) {
* Wrapper around fmt::print() that squelches write failure exceptions.
*/
template <typename... T>
void print(std::FILE* f, fmt::format_string<T...> fmt, T&&... args) {
inline void print(std::FILE* f, fmt::format_string<T...> fmt, T&&... args) {
try {
fmt::print(f, fmt, std::forward<T>(args)...);
} catch (const std::system_error&) {
Expand Down

0 comments on commit 0e346bb

Please sign in to comment.