Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Results tagged with compile-time
Search options not deleted
user 2325
For challenges involving doing something at compile-time, rather than run-time. This means that only compiled languages can compete.
54
votes
Accepted
Solve the eight queens problem at compile-time
My meta-program finds all 92 solutions. They are printed as error messages:
error: ‘solution’ is not a member of ‘std::integral_constant<int, 15863724>’
This means the first queen should be placed …
9
votes
Compute the CRC32 table at compile-time
The core loop
for (k = 0; k < 8; k++) {
if (c & 1) {
c = 0xedb88320L ^ (c >> 1);
} else {
c = c >> 1;
}
}
can be converted into a meta-function:
template <unsigned c, i …
17
votes
8
answers
11k
views
Compute the CRC32 table at compile-time [closed]
The reference implementation of CRC32 computes a lookup table at runtime:
/* Table of CRCs of all 8-bit messages. */
unsigned long crc_table[256];
/* Flag: has the table been computed? Initially fal …