Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2310)

Unified Diff: net/der/input.h

Issue 1146283004: Add a template-specialized constructor for der::Input for constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/der/input_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/der/input.h
diff --git a/net/der/input.h b/net/der/input.h
index 5814375a2e0dc032b12d5b30217a8648b563a705..6731b0c0600afd22f623141252b7e2b58d413061 100644
--- a/net/der/input.h
+++ b/net/der/input.h
@@ -41,6 +41,11 @@ class NET_EXPORT_PRIVATE Input {
// Creates an empty Input, one from which no data can be read.
Input();
+ // Creates an Input from a constant array |data|.
+ template <size_t N>
+ explicit Input(const uint8_t(&data)[N])
+ : data_(data), len_(N) {}
+
// Creates an Input from the given |data| and |len|.
Input(const uint8_t* data, size_t len);
« no previous file with comments | « no previous file | net/der/input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698