Skip to content

Commit

Permalink
🎇 Style: Use const reference for C++ class.
Browse files Browse the repository at this point in the history
	修改:     include/datetime.hpp
	修改:     source/datetime.cpp
  • Loading branch information
ChenPi11 committed Aug 24, 2023
1 parent f33b0f4 commit c4aaaeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ namespace CppEnhanced {

std::string ToString(int type, char d = '.', char t = ':') const;

std::string ToString(std::string format) const;
std::string ToString(const std::string& format) const;

std::wstring ToString(std::wstring format) const;
std::wstring ToString(const std::wstring& format) const;

bool Validate() noexcept;

Expand Down
4 changes: 2 additions & 2 deletions source/datetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ namespace CppEnhanced {
return _pub_osstream.str();
}

std::string DateTime::ToString(std::string format) const {
std::string DateTime::ToString(const std::string& format) const {

// Todo: to string

return std::string("");
}

std::wstring DateTime::ToString(std::wstring format) const {
std::wstring DateTime::ToString(const std::wstring& format) const {

// Todo: to wstring

Expand Down

0 comments on commit c4aaaeb

Please sign in to comment.