mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
testing the waters for c++11
please adjust your compiler options or complain if you rely on a compiler that doesn't support c++11 yet.
This commit is contained in:
parent
ad8114ddb0
commit
6c0f875385
2
Jamroot
2
Jamroot
@ -108,7 +108,7 @@ external-lib z ;
|
||||
|
||||
#lib dl : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
||||
#requirements += <library>dl ;
|
||||
|
||||
requirements += <toolset>gcc:<cxxflags>-std=c++0x ;
|
||||
|
||||
if ! [ option.get "without-tcmalloc" : : "yes" ] && [ test_library "tcmalloc_minimal" ] {
|
||||
if [ option.get "full-tcmalloc" : : "yes" ] {
|
||||
|
@ -1115,8 +1115,7 @@ void StaticData::LoadSparseWeightsFromConfig()
|
||||
}
|
||||
|
||||
std::map<std::string, std::vector<float> > weights = m_parameter->GetAllWeights();
|
||||
std::map<std::string, std::vector<float> >::iterator iter;
|
||||
for (iter = weights.begin(); iter != weights.end(); ++iter) {
|
||||
for (auto iter = weights.begin(); iter != weights.end(); ++iter) {
|
||||
// this indicates that it is sparse feature
|
||||
if (featureNames.find(iter->first) == featureNames.end()) {
|
||||
UTIL_THROW_IF2(iter->second.size() != 1, "ERROR: only one weight per sparse feature allowed: " << iter->first);
|
||||
|
@ -53,16 +53,16 @@ BOOST_AUTO_TEST_CASE(manager_configure_domain_except)
|
||||
//Check that configure rejects illegal domain arg combinations
|
||||
ScoreFeatureManager manager;
|
||||
BOOST_CHECK_THROW(
|
||||
manager.configure(boost::assign::list_of("--DomainRatio")("/dev/null")("--DomainIndicator")("/dev/null")),
|
||||
manager.configure({"--DomainRatio","/dev/null","--DomainIndicator","/dev/null"}),
|
||||
ScoreFeatureArgumentException);
|
||||
BOOST_CHECK_THROW(
|
||||
manager.configure(boost::assign::list_of("--SparseDomainSubset")("/dev/null")("--SparseDomainRatio")("/dev/null")),
|
||||
manager.configure({"--SparseDomainSubset","/dev/null","--SparseDomainRatio","/dev/null"}),
|
||||
ScoreFeatureArgumentException);
|
||||
BOOST_CHECK_THROW(
|
||||
manager.configure(boost::assign::list_of("--SparseDomainBlah")("/dev/null")),
|
||||
manager.configure({"--SparseDomainBlah","/dev/null"}),
|
||||
ScoreFeatureArgumentException);
|
||||
BOOST_CHECK_THROW(
|
||||
manager.configure(boost::assign::list_of("--DomainSubset")),
|
||||
manager.configure({"--DomainSubset"}),
|
||||
ScoreFeatureArgumentException);
|
||||
}
|
||||
|
||||
@ -84,16 +84,16 @@ static void checkDomainConfigured(
|
||||
BOOST_AUTO_TEST_CASE(manager_config_domain)
|
||||
{
|
||||
checkDomainConfigured<RatioDomainFeature>
|
||||
(boost::assign::list_of ("--DomainRatio")("/dev/null"));
|
||||
({"--DomainRatio","/dev/null"});
|
||||
checkDomainConfigured<IndicatorDomainFeature>
|
||||
(boost::assign::list_of("--DomainIndicator")("/dev/null"));
|
||||
({"--DomainIndicator","/dev/null"});
|
||||
checkDomainConfigured<SubsetDomainFeature>
|
||||
(boost::assign::list_of("--DomainSubset")("/dev/null"));
|
||||
({"--DomainSubset","/dev/null"});
|
||||
checkDomainConfigured<SparseRatioDomainFeature>
|
||||
(boost::assign::list_of("--SparseDomainRatio")("/dev/null"));
|
||||
({"--SparseDomainRatio","/dev/null"});
|
||||
checkDomainConfigured<SparseIndicatorDomainFeature>
|
||||
(boost::assign::list_of("--SparseDomainIndicator")("/dev/null"));
|
||||
({"--SparseDomainIndicator","/dev/null"});
|
||||
checkDomainConfigured<SparseSubsetDomainFeature>
|
||||
(boost::assign::list_of("--SparseDomainSubset")("/dev/null"));
|
||||
({"--SparseDomainSubset","/dev/null"});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user