Explain the std::ref recomendation for SmallFunction
That allows for implicit conversion of larger functions that get around
the assert for size in SmallFunction ctor - make SmallFunction useless.
Flag: EXEMPT text change
Test: none
Bug: none
Change-Id: I5a0c69193ec1b61f84cd3cadfc0e78c648b160b1
diff --git a/libs/binder/include/binder/Functional.h b/libs/binder/include/binder/Functional.h
index e153969..e9a3fe6 100644
--- a/libs/binder/include/binder/Functional.h
+++ b/libs/binder/include/binder/Functional.h
@@ -56,7 +56,9 @@
static_assert(sizeof(F) <= kFunctionBufferSize,
"Supplied callable is larger than std::function optimization buffer. "
- "Try using std::ref, but make sure lambda lives long enough to be called.");
+ "std::ref can avoid this or allow referencing a global function, "
+ "but you should avoid creating large callables that require allocations every "
+ "time");
}
template <typename T>