Automated analysis is the main advantage to working with a modern statically typed compiled language like C++. Code analysis tools can inform us when we have implemented an operator overload with a non-canonical form, when we should have made a method const, or when the scope of a variable can be reduced.
This file contains hidden or 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> | |
| #include <memory> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <type_traits> | |
| template< class ... > using void_t = void; | |
| template< class T , class = void > | |
| struct is_dereferenceable : std::false_type |
This file contains hidden or 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
| //https://gcc.godbolt.org/z/84hhzGoa4 | |
| #include <cstdint> | |
| #include <cstddef> | |
| #include <limits> | |
| #include <utility> | |
| #include <iostream> | |
| #include <string> | |
| constexpr auto seed() |
This file contains hidden or 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
| /* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the |
This file contains hidden or 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
| if [ $# -gt 1 ] | |
| then | |
| echo "Checking out LLVM '$1' branch from svn into '`pwd`/llvm' and setting install prefix to '$2'" | |
| echo "Press Return To Continue" | |
| read $VAR | |
| else | |
| echo "Usage: $0 <branch name> <install prefix>" | |
| exit | |
| fi |
This file contains hidden or 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 <chaiscript/chaiscript.hpp> | |
| #include <chaiscript/chaiscript_stdlib.hpp> | |
| class BaseClass | |
| { | |
| public: | |
| BaseClass() | |
| { | |
| } |
This file contains hidden or 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 <chrono> | |
| #include <string> | |
| #include <sstream> | |
| #include <vector> | |
| #include <iostream> | |
| std::string to_string(const int i) | |
| { | |
| std::stringstream ss; | |
| ss << i; |
This file contains hidden or 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
| " An example for a vimrc file. | |
| " | |
| " Maintainer: Bram Moolenaar <Bram@vim.org> | |
| " Last change: 2008 Jul 02 | |
| " | |
| " To use it, copy it to | |
| " for Unix and OS/2: ~/.vimrc | |
| " for Amiga: s:.vimrc | |
| " for MS-DOS and Win32: $VIM\_vimrc | |
| " for OpenVMS: sys$login:.vimrc |
This file contains hidden or 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 <chaiscript/chaiscript.hpp> | |
| std::string helloWorld(const std::string &t_name) { | |
| return "Hello " + t_name + "!"; | |
| } | |
| int main() { | |
| chaiscript::ChaiScript chai; | |
| chai.add(chaiscript::fun(&helloWorld), "helloWorld"); |
NewerOlder
