Skip to content

Commit

Permalink
move operator << in the global namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 23, 2024
1 parent 1362d48 commit 3e2f05f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/xtd.core/include/xtd/istringable.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace xtd {
/// @return A string that represents the current object.
virtual xtd::string to_string() const = 0;
/// @}

/// @cond
friend std::ostream& operator <<(std::ostream& os, const istringable& obj) noexcept;
/// @endcond
};
}

/// @cond
std::ostream& operator <<(std::ostream& os, const xtd::istringable& obj) noexcept;
/// @endcond
8 changes: 4 additions & 4 deletions src/xtd.core/include/xtd/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ namespace xtd {
private:
void __throw_invalid_cast_exception(const string& file, uint32 line, const string& method) const;
};

/// @cond
std::ostream& operator <<(std::ostream& os, const object& obj) noexcept;
/// @endcond
}

/// @cond
std::ostream& operator <<(std::ostream& os, const xtd::object& obj) noexcept;
/// @endcond

#include "type.h"

/*
Expand Down
3 changes: 1 addition & 2 deletions src/xtd.core/src/xtd/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void object::__throw_invalid_cast_exception(const string& file, uint32 line, con
throw invalid_cast_exception {{file, line, method}};
}

std::ostream& xtd::operator <<(std::ostream& os, const object& obj) noexcept {
std::ostream& operator <<(std::ostream& os, const object& obj) noexcept {
return os << obj.to_string();
}

0 comments on commit 3e2f05f

Please sign in to comment.