This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| genrule( | |
| name = 'single-header', | |
| out = 'mathutils.hpp', | |
| cmd = 'echo "' + single_header + '" > $OUT', | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| single_header = '\n'.join([ | |
| '#ifndef MATHUTILS_HPP', | |
| '#define MATHUTILS_HPP', | |
| '', | |
| ] + [ | |
| '#include <mathutils/' + i + '> ' for i, _ in mathutils_headers.items() | |
| ] + [ | |
| '', | |
| '#endif', | |
| '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| 'add.hpp': 'mathutils/include/add.hpp', | |
| 'sub.hpp': 'mathutils/include/sub.hpp' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print subdir_glob([ | |
| (‘mathutils/include’, ‘**/*.hpp’), | |
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mathutils | |
| ├── include | |
| │ ├── add.hpp | |
| │ └── sub.hpp | |
| └── src | |
| ├── add.cpp | |
| └── sub.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <mathutils/mathutils.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef MATHUTILS_SINGLE_INCLUDE_HPP | |
| #define MATHUTILS_SINGLE_INCLUDE_HPP | |
| #include <mathutils/add.hpp> | |
| #include <mathutils/sub.hpp> | |
| // etc… | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <mathutils/add.hpp> | |
| #include <mathutils/sub.hpp> | |
| // etc… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mathutils | |
| └── include | |
| ├── add.hpp | |
| ├── sub.hpp | |
| └── … |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| virtual void copy(void* memory) const { | |
| new (memory) Model<F, ReturnType, Xs...>(f); | |
| } | |
| template<unsigned rhsSize, std::enable_if_t<(rhsSize <= size), bool> = 0> | |
| SmallFun(SmallFun<ReturnType(Xs...), rhsSize> const& rhs) { | |
| rhs.copy(memory); | |
| } |