error checking for find operation on map
parent
630bc9144f
commit
b530c97b08
|
@ -56,11 +56,13 @@ public:
|
||||||
inline ConditionalGaussian::shared_ptr get (const std::string& key) const
|
inline ConditionalGaussian::shared_ptr get (const std::string& key) const
|
||||||
{
|
{
|
||||||
const_iterator cg = nodes.find(key); // get node
|
const_iterator cg = nodes.find(key); // get node
|
||||||
|
assert( cg != nodes.end() );
|
||||||
return cg->second;
|
return cg->second;
|
||||||
}
|
}
|
||||||
inline ConditionalGaussian::shared_ptr operator[](const std::string& key) const
|
inline ConditionalGaussian::shared_ptr operator[](const std::string& key) const
|
||||||
{
|
{
|
||||||
const_iterator cg = nodes.find(key); // get node
|
const_iterator cg = nodes.find(key); // get node
|
||||||
|
assert( cg != nodes.end() );
|
||||||
return cg->second;
|
return cg->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue