Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/bindings/generator.h

Issue 29532626: Issue 5603 - Support references in parameters of exported functions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created Aug. 31, 2017, 12:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/bindings/generator.h
===================================================================
--- a/compiled/bindings/generator.h
+++ b/compiled/bindings/generator.h
@@ -39,17 +39,18 @@ namespace bindings_internal
VOID,
INT,
INT64,
FLOAT,
DOUBLE,
DEPENDENT_STRING,
OWNED_STRING,
STRING_REF,
- CLASS_PTR
+ CLASS_PTR,
+ CLASS_REF
};
template<typename T>
struct TypeInfo
{
/*
* Since TypeInfo is a templated type, in practice the compiler will define
* a new type for each possible template parameter value. We use that fact
@@ -91,16 +92,19 @@ namespace bindings_internal
std::is_same<DependentString&, T>())
{
return TypeCategory::STRING_REF;
}
if (std::is_pointer<T>() && std::is_class<typename std::remove_pointer<T>::type>())
return TypeCategory::CLASS_PTR;
+ if (std::is_reference<T>() && std::is_class<typename std::remove_reference<T>::type>())
+ return TypeCategory::CLASS_REF;
+
return TypeCategory::UNKNOWN;
}
constexpr TYPEID pointer_type() const
{
if (std::is_pointer<T>())
return TypeInfo<typename std::remove_pointer<T>::type>();
else

Powered by Google App Engine
This is Rietveld