-/* Copyright (c) 2015-2020. The SimGrid Team.
+/* Copyright (c) 2015-2021. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
friend class Extendable<T>;
explicit constexpr Extension(std::size_t id) : id_(id) {}
public:
- explicit constexpr Extension() {}
+ explicit constexpr Extension() = default;
std::size_t id() const { return id_; }
bool valid() const { return id_ != INVALID_ID; }
};
{
return Extension<T, U>(extension_create([](void* p) { delete static_cast<U*>(p); }));
}
- Extendable() {}
+ Extendable() = default;
Extendable(const Extendable&) = delete;
Extendable& operator=(const Extendable&) = delete;
~Extendable()
extensions_[0]=data;
}
void* get_data() const { return extensions_[0]; }
- // Convenience extension access when the type has a associated EXTENSION ID:
+ // Convenience extension access when the type has an associated EXTENSION ID:
template <class U> U* extension() const { return extension<U>(U::EXTENSION_ID); }
template<class U> void extension_set(U* p) { extension_set<U>(U::EXTENSION_ID, p); }
};