summaryrefslogtreecommitdiffstats
path: root/contrib/python/pythran/pythran/pythonic/include/builtins/dict/fromkeys.hpp
blob: 0bcf1ff1e8660989f35b0212268ca9457d522f38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef PYTHONIC_INCLUDE_BUILTIN_DICT_FROMKEYS_HPP
#define PYTHONIC_INCLUDE_BUILTIN_DICT_FROMKEYS_HPP

#include "pythonic/include/builtins/None.hpp"
#include "pythonic/include/types/dict.hpp"
#include "pythonic/include/utils/functor.hpp"

#include <type_traits>

PYTHONIC_NS_BEGIN

namespace builtins
{

  namespace dict
  {

    template <class Iterable, class V = types::none_type>
    types::dict<typename std::remove_reference<Iterable>::type::value_type, V>
    fromkeys(Iterable &&iter, V const &v = builtins::None);

    DEFINE_FUNCTOR(pythonic::builtins::dict, fromkeys);
  }
}
PYTHONIC_NS_END

#endif