From fd9cf6247dedf54424d8e06ba54fde63b53fa5bd Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Sun, 14 Apr 2019 13:33:24 +0900 Subject: [PATCH] Corrected error handling of onUpload --- src/AutoConnectAux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AutoConnectAux.h b/src/AutoConnectAux.h index d9e443c..3bd7db1 100644 --- a/src/AutoConnectAux.h +++ b/src/AutoConnectAux.h @@ -64,8 +64,9 @@ class AutoConnectAux : public PageBuilder { void setTitle(const String& title) { _title = title; } /**< Set a title of the auxiliary page */ void on(const AuxHandlerFunctionT handler, const AutoConnectExitOrder_t order = AC_EXIT_AHEAD) { _handler = handler; _order = order; } /**< Set user handler */ void onUpload(PageBuilder::UploadFuncT uploadFunc) override { _uploadHandler = uploadFunc; } - template::value>::type> + template void onUpload(T& uploadClass) { + static_assert(std::is_base_of::value, "onUpload type must be inherited AutoConnectUploadHandler"); _uploadHandler = std::bind(&T::upload, &uploadClass, std::placeholders::_1, std::placeholders::_2); }