Page 15 of 15

Modern & Effective C++ design ideas

Posted: June 1st, 2014, 7:37 am
by Cuchulainn
QuoteOriginally posted by: outrunThat's why you need to make functions/algorithms non-member. Indeed, like visitors. Separate data and operations. The solution is beginning to look like a pre-GOF era visitor.And print() = 0 in a class is very bad design. I did this a while ago and then we rediscovered Visitor by migrating oprint to its own driver class(es). We need a devive context for print(Context& context) such as Console, AutioCAD etc.QuoteBtw they're pure virtual, no vtable.Fair enough, This is marginal. The real issue is Shape becomes a monolith, as I already mentioned. It flies in the face of SRP Summary: the main issue is how to maintain the explosion in the number of ops. like move() etc. 50 ops. is not unusual. Maybe a performance hit? then an option is buy a bigger machine. It's cheaper.

Modern & Effective C++ design ideas

Posted: October 13th, 2014, 4:57 pm
by Cuchulainn
This lambda looks like an attempt to emulate Lisp's CAR primitive. Cute.Is there also a lambda for CDR with auto? i.e. the opposite of CAR.