File: test_classes_extra.cpp

package info (click to toggle)
nanobind 2.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,300 kB
  • sloc: cpp: 12,232; python: 6,315; ansic: 4,813; makefile: 22; sh: 15
file content (22 lines) | stat: -rw-r--r-- 370 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "test_classes.h"

struct NeverDestruct::NDImpl{
    int var = 0;
};

NeverDestruct::NeverDestruct() {
    impl = std::make_unique<NeverDestruct::NDImpl>();
}

int NeverDestruct::var() const {
    return impl->var;
}

void NeverDestruct::set_var(int i) {
    impl->var = i;
}

NeverDestruct& NeverDestruct::make() {
    static NeverDestruct nd;
    return nd;
}