-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart Pointers support (see enhancement #194) #197
base: master
Are you sure you want to change the base?
Conversation
int remsize = delegate::call(source, [](Board &b) { return b.Size(); }); | ||
|
||
/* create a new board with an extra column to place the next queen */ | ||
Board *local = new Board(remsize+1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference would be to have clone
actually make an exact duplicate, and then have a method that would let you add a column to the end of a Board
. Seems cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance, insertQueen
could just resize the underlying array when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! I had that at some point, but the optimiser in me took over =P
I can restore that version tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, seeing as this meant to be the maximally-readable version, I'd like to keep the semantics of clone
as clean as possible.
Two top-level things:
|
. using #pragma once . using DVLOG(2) . changed the names of methods/functions to be more Grappa-like . More readable version of nqueens-smt
Basic smart pointers implementation.
I also added a version of NQueens using the smart pointer support and a basic unit test (which I am not totally sure if it is done correctly).