cs440-assignment3/SharedPtr.hpp
2024-12-09 00:32:18 -05:00

71 lines
2 KiB
C++

#ifndef _POWELLCS440
#include <cassert>
#include <iostream>
#define todo(msg) \
std::cerr << msg << std::endl; \
assert(false);
namespace cs440 {
template <typename T> class SharedPtr {
public:
SharedPtr() { todo("incomplete") }
template <typename U>
explicit SharedPtr(U *){todo("incomplete")} SharedPtr(const SharedPtr &p) {
todo("incomplete")
}
template <typename U>
SharedPtr(const SharedPtr<U> &p){
todo("incomplete")} SharedPtr(SharedPtr &&p) {
todo("asdf")
}
template <typename U>
SharedPtr(SharedPtr<U> &&p){todo("asdf")} SharedPtr &
operator=(const SharedPtr &) {
todo("")
}
template <typename U>
SharedPtr<T> &operator=(const SharedPtr<U> &){
todo("")} SharedPtr &operator=(SharedPtr &&p) {
todo("")
}
template <typename U> SharedPtr &operator=(SharedPtr<U> &&p) { todo("") }
~SharedPtr() { todo("") }
void reset() { todo("") }
template <typename U>
void reset(U *p){todo("")} T *get() const {todo("")} T &operator*() const {
todo("")} T *operator-> () const {
todo("")
}
explicit operator bool() const { todo("") }
};
template <typename T1, typename T2>
bool operator==(const SharedPtr<T1> &, const SharedPtr<T2> &) {
todo("")
}
template <typename T> bool operator==(const SharedPtr<T> &, std::nullptr_t) {
todo("")
}
template <typename T> bool operator==(std::nullptr_t, const SharedPtr<T> &) {
todo("")
}
template <typename T1, typename T2>
bool operator!=(const SharedPtr<T1> &, const SharedPtr<T2> &) {
todo("")
}
template <typename T> bool operator!=(const SharedPtr<T> &, std::nullptr_t) {
todo("")
}
template <typename T> bool operator!=(std::nullptr_t, const SharedPtr<T> &) {
todo("")
}
template <typename T, typename U>
SharedPtr<T> static_pointer_cast(const SharedPtr<U> &sp) {
todo("")
}
template <typename T, typename U>
SharedPtr<T> dynamic_pointer_cast(const SharedPtr<U> &sp) {
todo("")
}
} // namespace cs440
#endif