mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Compiles/links assignment to string
This commit is contained in:
@@ -16,7 +16,7 @@ namespace YAML
|
|||||||
class node_data
|
class node_data
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit node_data(const std::string& data);
|
explicit node_data(const std::string& data) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,15 +61,13 @@ namespace YAML
|
|||||||
m_pNode->set_scalar(rhs);
|
m_pNode->set_scalar(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
inline void Value::Assign(const char *rhs)
|
||||||
inline void Value::Assign(const char * const & rhs)
|
|
||||||
{
|
{
|
||||||
EnsureNodeExists();
|
EnsureNodeExists();
|
||||||
m_pNode->set_scalar(rhs);
|
m_pNode->set_scalar(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
inline void Value::Assign(char *rhs)
|
||||||
inline void Value::Assign(char * const & rhs)
|
|
||||||
{
|
{
|
||||||
EnsureNodeExists();
|
EnsureNodeExists();
|
||||||
m_pNode->set_scalar(rhs);
|
m_pNode->set_scalar(rhs);
|
||||||
|
@@ -61,6 +61,8 @@ namespace YAML
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename T> void Assign(const T& rhs);
|
template<typename T> void Assign(const T& rhs);
|
||||||
|
void Assign(const char *rhs);
|
||||||
|
void Assign(char *rhs);
|
||||||
|
|
||||||
void EnsureNodeExists();
|
void EnsureNodeExists();
|
||||||
void AssignData(const Value& rhs);
|
void AssignData(const Value& rhs);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
YAML::Value value;
|
YAML::Value value;
|
||||||
|
value = "Hello";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user