Archived
1
Fork 0

Update clang-format again

This commit is contained in:
Joshua Goins 2022-08-15 11:03:19 -04:00
parent 9656552878
commit 924d60e99b
3 changed files with 27 additions and 8 deletions

View file

@ -25,5 +25,10 @@ AlignAfterOpenBracket: AlwaysBreak
BinPackArguments: false BinPackArguments: false
BinPackParameters: false BinPackParameters: false
ColumnLimit: 120 ColumnLimit: 120
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: 'Empty'
AllowShortLambdasOnASingleLine: 'Empty'
AllowShortLoopsOnASingleLine: 'false'
SeparateDefinitionBlocks : 'Always'
... ...

View file

@ -26,7 +26,9 @@ public:
return AssetPtr<T>(AssetStore<T>::at(p).get(), reference_block); return AssetPtr<T>(AssetStore<T>::at(p).get(), reference_block);
} }
template<typename T> AssetPtr<T> get(const prism::path path) { return fetch<T>(path, get_reference_block(path)); } template<typename T> AssetPtr<T> get(const prism::path path) {
return fetch<T>(path, get_reference_block(path));
}
template<typename T> std::vector<T*> get_all() { template<typename T> std::vector<T*> get_all() {
std::vector<T*> assets; std::vector<T*> assets;

View file

@ -15,7 +15,9 @@ public:
template<class T> struct AssetPtr { template<class T> struct AssetPtr {
AssetPtr() = default; AssetPtr() = default;
AssetPtr(T* ptr, ReferenceBlock* block) : handle(ptr), block(block) { block->references++; } AssetPtr(T* ptr, ReferenceBlock* block) : handle(ptr), block(block) {
block->references++;
}
AssetPtr(const AssetPtr& rhs) { AssetPtr(const AssetPtr& rhs) {
handle = rhs.handle; handle = rhs.handle;
@ -53,13 +55,23 @@ template<class T> struct AssetPtr {
T* handle = nullptr; T* handle = nullptr;
ReferenceBlock* block = nullptr; ReferenceBlock* block = nullptr;
explicit operator bool() const { return handle != nullptr; } explicit operator bool() const {
return handle != nullptr;
}
T* operator->() { return handle; } T* operator->() {
return handle;
}
T* operator->() const { return handle; } T* operator->() const {
return handle;
}
T* operator*() { return handle; } T* operator*() {
return handle;
}
T* operator*() const { return handle; } T* operator*() const {
return handle;
}
}; };