test | function size | execution time |
---|---|---|
cc-O0-no_unwind | 242 bytes | 181.44 |
cc-O0-unwind_dontcare | 274 bytes | 216.39 |
cc-O0-unwind_noexcept | 230 bytes | 215.46 |
cc-O0-unwind_throwing | 353 bytes | 215.35 |
cc-O0-unwind_catching | 385 bytes | 215.07 |
cc-O2-no_unwind | 108 bytes | 25.74 |
cc-O2-unwind_dontcare | 132 bytes | 26.05 |
cc-O2-unwind_noexcept | 108 bytes | 25.78 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdexcept> | |
#include <stdio.h> | |
static int objects; | |
class IntWithDestructor { | |
int val; | |
public: | |
IntWithDestructor() : val{} { objects++; } |
test | function size (bytes) | execution time (seconds) |
---|---|---|
test-cc-O3-no_unwind | 679 bytes | 21.30 |
test-cc-O3-unwind_catching | 723 bytes | 19.11 |
test-cc-O3-unwind_dontcare | 679 bytes | 21.28 |
test-cc-O3-unwind_noexcept | 679 bytes | 21.29 |
test-cc-O3-unwind_throwing | 747 bytes | 21.30 |
test-c-O3 | 679 bytes | 21.27 |
test | function size (bytes) | execution time (seconds) |
---|---|---|
test-cc-O2-no_unwind | 679 bytes | 21.31 |
test-cc-O2-unwind_catching | 172 bytes | 29.78 |
test-cc-O2-unwind_dontcare | 679 bytes | 21.30 |
test-cc-O2-unwind_noexcept | 679 bytes | 21.36 |
test-cc-O2-unwind_throwing | 159 bytes | 23.05 |
test-c-O2 | 679 bytes | 21.29 |
test | function size (bytes) | execution time (seconds) |
---|---|---|
test-cc-O0-no_unwind | 91 bytes | 55.88 |
test-cc-O0-unwind_catching | 211 bytes | 68.59 |
test-cc-O0-unwind_dontcare | 89 bytes | 54.04 |
test-cc-O0-unwind_noexcept | 89 bytes | 55.92 |
test-cc-O0-unwind_throwing | 176 bytes | 62.99 |
test-c-O0 | 89 bytes | 54.32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdexcept> | |
#include <stdio.h> | |
static int result; | |
int fibonacci(int i) { | |
// Optimize the branch prediction | |
if (i <= 1) [[unlikely]] { | |
if (i < 0) | |
throw std::runtime_error{"Negative number"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Does std::logic_error copy the string | |
// or takes a reference? | |
// | |
// The C++ specifications are deliberately vague | |
// | |
// With MSVC, try compiling this with 1 and with 0 | |
// You will be very surprised | |
// | |
#define _HAS_EXCEPTIONS 1 | |
#include <stdexcept> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transform a single bison item to named references | |
* | |
* For example to transform only "c_decl" | |
* | |
* node transform.js Source/CParse/parser.y c_decl Source/CParse/parser.y | |
*/ | |
const fs = require('fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Magick++.h> | |
#include <exception> | |
#include <functional> | |
#include <string> | |
typedef std::function<const char *()> MakeErr; | |
class LambdaException : public std::exception { | |
MakeErr get_err; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
auto err = std::logic_error("some error"); | |
std::cout << err.what() << std::endl; | |
// using the derived copy constructor | |
std::logic_error err2 = err; | |
std::cout << err2.what() << std::endl; |
NewerOlder