data/train/cpp/323d6e1ca67ea9d4ed5ae3db303ae8a4000cfd92Sample.cc
Sample::value_type GetSampleFromName(const std::string& sample_name)
    {
        for (const auto& sample_info : Sample::GetInfos())
        {
            if (sample_info.name == sample_name)
            {
                return sample_info.sample; 
            }
        }

        // throw if not found
        throw std::domain_error(Form("[dy::GetSampleInfo] Error: sample %s not found!", sample_name.c_str()));
    }
// Get the Sample from a string
Get the Sample from a string
Get the Sample from a string
Sample::value_type GetSampleFromName(const std::string& sample_name)
    {
        for (const auto& sample_info : Sample::GetInfos())
        {
            if (sample_info.name == sample_name)
            {
                return sample_info.sample; 
            }
        }
        throw std::domain_error(Form("[dy::GetSampleInfo] Error: sample %s not found!", sample_name.c_str()));
    }
Sample :: value_type GetSampleFromName ( const std :: string & sample_name ) { for ( const auto & sample_info : Sample :: GetInfos ( ) ) { if ( sample_info . name == sample_name ) { return sample_info . sample ; } } throw std :: domain_error ( Form ( " " , sample_name . c_str ( ) ) ) ; }
Get the Sample from a string
Get the Sample from a string
// throw if not found