mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
more testing of c++11 waters
This commit is contained in:
parent
f66beabf4f
commit
f7c3d00824
@ -26,6 +26,7 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
using namespace MosesTraining;
|
||||
using namespace std;
|
||||
@ -81,6 +82,16 @@ static void checkDomainConfigured(
|
||||
BOOST_CHECK(manager.includeSentenceId());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T adder(T v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, typename... Args>
|
||||
T adder(T first, Args... args) {
|
||||
return first + adder(args...);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(manager_config_domain)
|
||||
{
|
||||
checkDomainConfigured<RatioDomainFeature>
|
||||
@ -102,8 +113,23 @@ BOOST_AUTO_TEST_CASE(manager_config_domain)
|
||||
s.insert(4);
|
||||
s.insert(1);
|
||||
|
||||
for (auto i: s) {
|
||||
for (auto i: s) {
|
||||
cerr << i << " ";
|
||||
}
|
||||
|
||||
unordered_map<std::string, int> m;
|
||||
m["a"] = 4;
|
||||
m["ba"] = 6;
|
||||
m["aabc"] = 7;
|
||||
|
||||
for (auto i: m) {
|
||||
cerr << i.first << "=" << i.second << " ";
|
||||
}
|
||||
|
||||
long sum = adder(1, 2, 3, 8, 7);
|
||||
|
||||
std::string s1 = "x", s2 = "aa", s3 = "bb", s4 = "yy";
|
||||
std::string ssum = adder(s1, s2, s3, s4);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user