Download data/applications/test/alloc/Test.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 586 Bytes
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/test/alloc/Test.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/applications/test/alloc/Test.C
-
curl -L -o Test.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/test/alloc/Test.C
586 Bytes
| class Int | |
| { | |
| int I; | |
| public: | |
| Int(){} | |
| operator int() | |
| { | |
| return I; | |
| } | |
| }; | |
| template<class T> | |
| class List : public T | |
| { | |
| T* v; | |
| int sz; | |
| public: | |
| List() | |
| { | |
| v = new T[sz=10]; | |
| } | |
| List(int s) | |
| { | |
| v = new T[sz=s]; | |
| } | |
| ~List() | |
| { | |
| delete[] v; | |
| } | |
| inline int size() const; | |
| }; | |
| template<class T> | |
| inline int List<T>::size() const | |
| { | |
| return sz; | |
| } | |
| main() | |
| { | |
| typedef List<Int> intList; | |
| intList list(10); | |
| cout << list.size() << "\n"; | |
| return 0; | |
| } | |