Пример #1
0
    /*!
     * Using initializer lists is problematic, since GCC 4.6 has an extension
     * which can deduce {{ "value", "42" }} expressions in function call to
     * the initializer list without looking at the overload resolution.
     * This behaviour violates C++11 standard, which allows such deducing only
     * for `auto` keyword (including range-based `for` loop).
     * Please, specify `attribute::list` type explicitly when using initializer
     * lists to provide attributes.
     */
    pusher_t&
    operator()(std::initializer_list<
                   std::pair<std::string, attribute::value_t>
               >&& args)
    {
        for (auto it = args.begin(); it != args.end(); ++it) {
            record.insert(
                std::make_pair(it->first, attribute_t(it->second))
            );
        }

        return *this;
    }
Пример #2
0
inline
pair_t
make(const name_t& name, T&& value) {
    return std::make_pair(name, attribute_t(std::forward<T>(value)));
}
Пример #3
0
inline
pair_t
make(const name_t& name, T&& value, scope_t scope = DEFAULT_SCOPE) {
    return std::make_pair(name, attribute_t(std::move(value), scope));
}