/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// extended. The comparison deliberately strips cv-qualifieers and
// reference, leaving that choice up to the caller.
template <typename Fn, typename... Args>
-constexpr bool hasArgumentTypes() {
- using HasArgumentTypes = typename boost::mpl::template equal<
- typename boost::mpl::template transform<
- typename boost::mpl::template transform<
- ArgumentTypes<Fn>,
- typename std::template remove_reference<boost::mpl::_1>
- >::type,
- typename std::template remove_cv<boost::mpl::_1>
- >::type,
- boost::mpl::vector<Args...>
- >::type;
- return HasArgumentTypes::value;
-}
+struct HasArgumentTypes
+ : boost::mpl::template equal<
+ typename boost::mpl::template transform<
+ typename boost::mpl::template transform<
+ ArgumentTypes<Fn>,
+ typename std::template remove_reference<boost::mpl::_1>>::
+ type,
+ typename std::template remove_cv<boost::mpl::_1>>::type,
+ boost::mpl::vector<Args...>>::type {};
template <typename... Args>
using EnableForArgTypes =
- typename std::enable_if<hasArgumentTypes<Args...>(), void>::type;
+ typename std::enable_if<HasArgumentTypes<Args...>::value, void>::type;
// No arguments
template <typename Fn> EnableForArgTypes<Fn>
void DynamicParser::wrapError(const folly::dynamic* lookup_k, Fn fn) {
try {
fn();
- } catch (DynamicParserLogicError& ex) {
+ } catch (DynamicParserLogicError&) {
// When the parser is misused, we throw all the way up to the user,
// instead of reporting it as if the input is invalid.
throw;
- } catch (DynamicParserParseError& ex) {
+ } catch (DynamicParserParseError&) {
// We are just bubbling up a parse error for OnError::THROW.
throw;
} catch (const std::exception& ex) {