3 ms·
Rumor has it theres a coding standards manual floating around at IBM that forbids the use of pointers. In c++. Yes indeed.
by Dilpil 17y ago
Rumor has it theres a coding standards manual floating around at IBM that forbids the use of pointers. In c++. Yes indeed.
- extension 17y agoNo problem template <typename T> class NotAPointer { T* m_pointer; T* set(T* p) { return m_pointer = p; } T* get() { return m_pointer; } NotAPointer(T* p) { set(p); } } Just outsource that and you're pointer free!
- swolchok 17y agoI see how you've cleverly perpetuated the policy by forgetting to make the methods public.
- extension 17y agoAs it was the first C++ I've written in nearly a decade, I'm surprised I remembered as much as I did. I should have also made the set parameter a reference to better obscure the involvement of pointers.
- lacker 17y agomaybe they always use scoped_ptr / linked_ptr?