add some final kw

This commit is contained in:
blueloveTH 2023-04-14 21:24:48 +08:00
parent c7ec20a11e
commit 83b059b24f
3 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@
namespace pkpy{
class RangeIter : public BaseIter {
class RangeIter final: public BaseIter {
i64 current;
Range r; // copy by value, so we don't need to keep ref
public:
@ -25,7 +25,7 @@ public:
};
template <typename T>
class ArrayIter : public BaseIter {
class ArrayIter final: public BaseIter {
PyObject* ref;
int index;
public:
@ -42,7 +42,7 @@ public:
}
};
class StringIter : public BaseIter {
class StringIter final: public BaseIter {
PyObject* ref;
int index;
public:

View File

@ -111,7 +111,7 @@ template<typename T>
void gc_mark(T& t);
template <typename T>
struct Py_ : PyObject {
struct Py_ final: PyObject {
T _value;
Py_(Type type, const T& val): PyObject(type), _value(val) { _init(); }

View File

@ -32,7 +32,7 @@ Str _read_file_cwd(const Str& name, bool* ok);
inline PyObject* py_var(VM* vm, ctype&& value) { return vm->heap.gcnew(vm->ptype, std::move(value));}
class Generator: public BaseIter {
class Generator final: public BaseIter {
Frame frame;
int state; // 0,1,2
public: