로딩중...
검색중...
일치하는것 없음
params.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
4#include "core/ast/scope.hpp"
6#include "core/ast/param.hpp"
7
8namespace by {
9 typedef std::vector<std::string> strings;
10
16 class _nout params: public tnarr<param> {
18
19 public:
20 params();
21 params(const me& rhs) = default;
22
30 template <typename... Es> explicit params(const Es&... elems) {
31 static_assert(areBaseOfT<param, Es...>::value, "some of type of args are not base of type `T`");
32 add({(param*) &elems...});
33 }
34
35 public:
36 me& operator=(const me& rhs) = default;
37 nbool operator==(const me& rhs) const;
38 nbool operator!=(const me& rhs) const;
39
40 public:
44 std::string toStr() const;
45
52 static me make(const strings& names, const narr& args);
58 static me make(const narr& args);
59 };
60
65 class _nout dumParams: public params {
67
68 public:
69 using tucontainable<param>::set;
70 using tarrayable<param>::set;
71
72 nbool set(const iter& at, const param& new1) override { return true; }
73
74 nbool set(nidx n, const param& new1) override { return true; }
75
76 using tucontainable<param>::add;
77 using tarrayable<param>::add;
78
79 nbool add(const iter& at, const param& new1) override { return true; }
80
81 nbool add(nidx n, const param& new1) override { return true; }
82
83 void add(const iter& here, const iter& from, const iter& to) override {}
84 };
85} // namespace by
Function or object evaluation arguments
Definition args.hpp:22
Dummy parameter container that ignores all operations
Definition params.hpp:65
Function parameter
Definition param.hpp:14
Function parameter list container
Definition params.hpp:16
static me make(const strings &names, const narr &args)
Creates a params object from a list of names and a list of argument nodes.
params(const Es &... elems)
Constructs a params object by adding multiple param elements.
Definition params.hpp:30
std::string toStr() const
static me make(const narr &args)
Creates a params object from a list of argument nodes, inferring names if possible.
Definition tarrayable.hpp:11
Definition tnarr.hpp:9
Template unidirectional container interface
Definition tucontainable.hpp:20
Bidirectional iterator for key-value containers
Definition biter.hpp:10
to Top