Skip to content

Commit

Permalink
Revert "ssBuffer_ dynamic"
Browse files Browse the repository at this point in the history
This reverts commit 44832ad.
  • Loading branch information
talregev committed Dec 31, 2023
1 parent 3a10194 commit 49aed42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions gtsam/base/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace gtsam {

std::string RedirectCout::str() const {
return ssBuffer_->str();
return ssBuffer_.str();
}

RedirectCout::~RedirectCout() {
std::cout.rdbuf(coutBuffer_);
delete ssBuffer_;
}

}
4 changes: 2 additions & 2 deletions gtsam/base/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace gtsam {
*/
struct GTSAM_EXPORT RedirectCout {
/// constructor -- redirect stdout buffer to a stringstream buffer
RedirectCout() : ssBuffer_(new std::stringstream()), coutBuffer_(std::cout.rdbuf(ssBuffer_->rdbuf())) {}
RedirectCout() : ssBuffer_(), coutBuffer_(std::cout.rdbuf(ssBuffer_.rdbuf())) {}

/// return the string
std::string str() const;
Expand All @@ -24,7 +24,7 @@ struct GTSAM_EXPORT RedirectCout {
~RedirectCout();

private:
std::stringstream* ssBuffer_;
std::stringstream ssBuffer_;
std::streambuf* coutBuffer_;
};

Expand Down

0 comments on commit 49aed42

Please sign in to comment.