Write `typename' in templates rather than `class'.
Change-Id: I4d86f3985dc5161da221e0f29d9077b08d33461e
Reviewed-on: https://code-review.googlesource.com/c/re2/+/57830
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/re2.h b/re2/re2.h
index 6593ce8..89f4fbb 100644
--- a/re2/re2.h
+++ b/re2/re2.h
@@ -805,7 +805,7 @@
// Hex/Octal/Binary?
// Special class for parsing into objects that define a ParseFrom() method
-template <class T>
+template <typename T>
class _RE2_MatchObject {
public:
static inline bool Parse(const char* str, size_t n, void* dest) {
@@ -851,9 +851,9 @@
#undef MAKE_PARSER
// Generic constructor templates
- template <class T> Arg(T* p)
+ template <typename T> Arg(T* p)
: arg_(p), parser_(_RE2_MatchObject<T>::Parse) { }
- template <class T> Arg(T* p, Parser parser)
+ template <typename T> Arg(T* p, Parser parser)
: arg_(p), parser_(parser) { }
// Parse the data
diff --git a/re2/testing/charclass_test.cc b/re2/testing/charclass_test.cc
index a2837a6..9c2a32f 100644
--- a/re2/testing/charclass_test.cc
+++ b/re2/testing/charclass_test.cc
@@ -85,7 +85,7 @@
{ {-1} } },
};
-template<class CharClass>
+template <typename CharClass>
static void Broke(const char *desc, const CCTest* t, CharClass* cc) {
if (t == NULL) {
printf("\t%s:", desc);
@@ -136,7 +136,7 @@
delete cc;
}
-template<class CharClass>
+template <typename CharClass>
bool CorrectCC(CharClass *cc, CCTest *t, const char *desc) {
typename CharClass::iterator it = cc->begin();
int size = 0;
diff --git a/util/pcre.h b/util/pcre.h
index 644dce6..896b0bd 100644
--- a/util/pcre.h
+++ b/util/pcre.h
@@ -555,7 +555,7 @@
// Hex/Octal/Binary?
// Special class for parsing into objects that define a ParseFrom() method
-template <class T>
+template <typename T>
class _PCRE_MatchObject {
public:
static inline bool Parse(const char* str, size_t n, void* dest) {
@@ -600,9 +600,9 @@
#undef MAKE_PARSER
// Generic constructor
- template <class T> Arg(T*, Parser parser);
+ template <typename T> Arg(T*, Parser parser);
// Generic constructor template
- template <class T> Arg(T* p)
+ template <typename T> Arg(T* p)
: arg_(p), parser_(_PCRE_MatchObject<T>::Parse) {
}