Addenda to constexpr evaluation
It turns out the compiler can, in the interests of "optimization", actually choose to evaluate constexpr's at run time (live and learn)! In those case, it appears to be setting aside the storage for the "constant", calculating it at run time, but treating it as read only after the value is initially set. In that case it appears the only way to be certain whether it is performing the computation at compile time is to break out the compile-to-assembly option - which I won't require folks to do. Since C++14, things have changed further, allowing the use of non-constexpr variables within constexpr functions. It appears that going back to compiling with -std=c++11 gives stricter controls over this, but limits the body of a constexpr function to being strictly a return statement (though nested :? operators can still be embedded within that). |
To obtain, edit, and submit the assignment, follow the instructions below to fork/clone the git repository, editing the required source code files in the repository you clone, and then submitting your updated repository.
The specific assignment instructions can be found in the README file in the cloned repository.
The assignment must be submitted using the process below by 5pm on March 6th.
Late penalties are detailed in the main CSCI 485 labs page.
For this assignment (and all CSCI 485 assignments this term) you will be using an adaptation of the git version control system to obtain the assignment material, to track changes as you make them, and ultimately to submit your completed assignment.
You must use this system to obtain and submit your work - no other mechanism will be accepted.
The specific instructions to obtain, edit, and submit this assignment are as follows:
Obtaining the assignment material Sometime after the instructor has announced that the material has been posted, log into otter (or one of the cubs/pups) and follow the instructions below. The instructions are case sensitive and are to be entered exactly as shown, including the work $USER exactly as shown, ONCE ONLY. (They create a repository for you on a central server and copy that repository to your account - doing this multiple times is highly likely to cause issues!) If it looks like an instruction failed then stop and check with the instructor before proceeding to the next step.
| |
Working on your assignment In your csci485/assign3 directory you should find, among other things, a README file containing the assignment instructions and requirements, plus descriptions of any other relevant files in the repository. | |
Submitting your completed assignment You can submit your assignment as often as you wish, each new submission copies your new updates/alterations to the version of your assignment stored on the central git server. If you don't do these steps successfully prior to the submission deadline then your work is not submitted and you get zero for the assignment. Make sure you are in your assign3 directory on otter or one of the pups/cubs, then follow these instructions: git add . git add -u git commit -m "committing for submit" git push |