aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pythran/pythran/pythonic/builtins/set/intersection_update.hpp
blob: 5bf8b65a814597f7d752bd1275f9fa64e8b6d445 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef PYTHONIC_BUILTIN_SET_INTERSECTIONUPDATE_HPP
#define PYTHONIC_BUILTIN_SET_INTERSECTIONUPDATE_HPP

#include "pythonic/include/builtins/set/intersection_update.hpp"

#include "pythonic/types/set.hpp"
#include "pythonic/utils/functor.hpp"

PYTHONIC_NS_BEGIN

namespace builtins
{

  namespace set
  {

    template <typename T, typename... Types>
    types::none_type intersection_update(types::set<T> &set,
                                         Types const &... others)
    {
      set.intersection_update(others...);
      return {};
    }

    template <typename T, typename... Types>
    types::none_type intersection_update(types::set<T> &&set,
                                         Types const &... others)
    {
      // If it is an rvalue, we don't really want to update
      return {};
    }

    template <typename... Types>
    types::none_type intersection_update(types::empty_set &&set,
                                         Types const &... others)
    {
      // If it is an empty_set, it is ! really updated otherwise we have a
      // typing issue
      return {};
    }
  }
}
PYTHONIC_NS_END
#endif