fixed returning reference to temp object
TODO: change signiture to return boost::optional<std::string const&> and fix crufty logic
This commit is contained in:
parent
4ef9cd8b45
commit
5654759a22
1 changed files with 3 additions and 1 deletions
|
@ -338,6 +338,7 @@ T xml_node::get_attr(std::string const& name) const
|
|||
|
||||
std::string const& xml_node::get_text() const
|
||||
{
|
||||
// FIXME : return boost::optional<std::string const&>
|
||||
if (children_.empty())
|
||||
{
|
||||
if (is_text_)
|
||||
|
@ -346,7 +347,8 @@ std::string const& xml_node::get_text() const
|
|||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
const static std::string empty;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
if (children_.size() == 1)
|
||||
|
|
Loading…
Reference in a new issue