aboutsummaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorFredrik Roubert <roubert@google.com>2014-06-16 20:48:52 +0000
committerFredrik Roubert <roubert@google.com>2014-09-01 19:20:47 +0200
commite7b6e1ed48d0a5ddee5b88ab73f4fecfa8280c26 (patch)
treea55bb22e02e4fd22ab2e6ee77fa41f259c42e72a /cpp/src
parent483950188a2912403514b4a00f492eb0b415f06c (diff)
downloadsrc-e7b6e1ed48d0a5ddee5b88ab73f4fecfa8280c26.tar.gz
Make the Callback templates more generic.
Instead of unconditionally adding const& to the specified types, require the user of the Callback templates to specify it. This makes it possible to use these same templates also for other types. Now, const int& is replaced with just plain int. Later, this will be used to replace const std::string& with std::string*. R=rouslan@chromium.org
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/retriever.h3
-rw-r--r--cpp/src/rule_retriever.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/retriever.h b/cpp/src/retriever.h
index f3f7e18..17d17ec 100644
--- a/cpp/src/retriever.h
+++ b/cpp/src/retriever.h
@@ -42,7 +42,8 @@ class ValidatingStorage;
// retriever.Retrieve("data/CA/AB--fr", *retrieved);
class Retriever {
public:
- typedef i18n::addressinput::Callback<std::string, std::string> Callback;
+ typedef i18n::addressinput::Callback<const std::string&,
+ const std::string&> Callback;
// Takes ownership of |downloader| and |storage|.
Retriever(const std::string& validation_data_url,
diff --git a/cpp/src/rule_retriever.h b/cpp/src/rule_retriever.h
index a44fb63..ba3b4c7 100644
--- a/cpp/src/rule_retriever.h
+++ b/cpp/src/rule_retriever.h
@@ -37,7 +37,8 @@ class Rule;
// rules.RetrieveRule("data/CA/AB--fr", *rule_ready);
class RuleRetriever {
public:
- typedef i18n::addressinput::Callback<std::string, Rule> Callback;
+ typedef i18n::addressinput::Callback<const std::string&,
+ const Rule&> Callback;
// Takes ownership of |retriever|.
explicit RuleRetriever(const Retriever* retriever);