Skip to content

Commit

Permalink
One definition rule (inline function) (#75)
Browse files Browse the repository at this point in the history
If I end up including meta.h in multiple .cpp files linker complains about multiple definition of the "op_to_string" function. Defining the function as inline fixes the problem.
  • Loading branch information
simon-hrabec authored and PatWie committed Feb 3, 2017
1 parent 20eb792 commit e94e71c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cppoptlib/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ inline std::ostream &operator<<(std::ostream &os, const SimplexOp &op) {
return os;
}

std::string op_to_string(SimplexOp op) {
inline std::string op_to_string(SimplexOp op) {
switch (op) {
case SimplexOp::Place:
return "place";
Expand Down

0 comments on commit e94e71c

Please sign in to comment.