mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-13 00:00:06 +00:00
feat: enable to swap comment and strings
This commit is contained in:
parent
24a05c7c93
commit
87e0ba201e
@ -162,12 +162,15 @@ struct preserve_comments
|
|||||||
const_reverse_iterator crbegin() const noexcept {return comments.crbegin();}
|
const_reverse_iterator crbegin() const noexcept {return comments.crbegin();}
|
||||||
const_reverse_iterator crend() const noexcept {return comments.crend();}
|
const_reverse_iterator crend() const noexcept {return comments.crend();}
|
||||||
|
|
||||||
friend bool operator==(const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator==(const preserve_comments&, const preserve_comments&);
|
||||||
friend bool operator!=(const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator!=(const preserve_comments&, const preserve_comments&);
|
||||||
friend bool operator< (const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator< (const preserve_comments&, const preserve_comments&);
|
||||||
friend bool operator<=(const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator<=(const preserve_comments&, const preserve_comments&);
|
||||||
friend bool operator> (const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator> (const preserve_comments&, const preserve_comments&);
|
||||||
friend bool operator>=(const preserve_comments& lhs, const preserve_comments& rhs);
|
friend bool operator>=(const preserve_comments&, const preserve_comments&);
|
||||||
|
|
||||||
|
friend void swap(preserve_comments&, std::vector<std::string>&);
|
||||||
|
friend void swap(std::vector<std::string>&, preserve_comments&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -186,6 +189,16 @@ inline void swap(preserve_comments& lhs, preserve_comments& rhs)
|
|||||||
lhs.swap(rhs);
|
lhs.swap(rhs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
inline void swap(preserve_comments& lhs, std::vector<std::string>& rhs)
|
||||||
|
{
|
||||||
|
lhs.comments.swap(rhs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inline void swap(std::vector<std::string>& lhs, preserve_comments& rhs)
|
||||||
|
{
|
||||||
|
lhs.swap(rhs.comments);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename charT, typename traits>
|
template<typename charT, typename traits>
|
||||||
std::basic_ostream<charT, traits>&
|
std::basic_ostream<charT, traits>&
|
||||||
|
Loading…
Reference in New Issue
Block a user