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
# windows32-toolchain.cmake | |
# Specify the cross-compilation target system | |
set(CMAKE_SYSTEM_NAME Windows) | |
set(CMAKE_SYSTEM_PROCESSOR x86) | |
# Specify the cross-compilation toolchain | |
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) | |
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) |
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
#!/bin/bash | |
#set -o xtrace | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
IFS=$'\t\n' | |
unset CDPATH | |
for f in * | |
do |
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
// Pretty-printer for `struct` layout and padding bytes | |
// by Vittorio Romeo (@supahvee1234) (https://vittorioromeo.info) | |
#include <boost/pfr.hpp> | |
#include <iostream> | |
#include <tuple> | |
#include <utility> | |
#include <type_traits> | |
#include <typeinfo> | |
#include <cmath> |
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 <utility> | |
#include <fmt/printf.h> | |
constexpr bool verboseMode{false}; | |
constexpr bool logPrinting{false}; | |
namespace my { | |
template<typename ... T> | |
inline void print(T &&... args) { | |
if constexpr(!verboseMode) {} |
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 <algorithm> | |
#include <boost/iterator/filter_iterator.hpp> | |
template <class Iter, class Predicate> | |
void reverse_if(Iter first, Iter last, Predicate pred) { | |
std::reverse(boost::make_filter_iterator(pred, first, last), | |
boost::make_filter_iterator(pred, last, last)); | |
} | |
#include <locale> |
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
template<typename T> | |
class SingleThreadedPtr { | |
T *m_p; | |
mutable unsigned *m_c; | |
public: | |
SingleThreadedPtr(); | |
explicit SingleThreadedPtr(T *a_p); | |
SingleThreadedPtr(SingleThreadedPtr const &a_rhs); | |
SingleThreadedPtr(SingleThreadedPtr &&a_rhs); | |
~SingleThreadedPtr(); |
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
FROM centos:7.5.1804 | |
RUN yum -y update && yum -y install redhat-lsb | |
RUN yum -y install gcc-c++ | |
RUN yum -y install cmake | |
WORKDIR /opt/cppcheck | |
ADD https://github.com/danmar/cppcheck/archive/1.85.tar.gz . | |
RUN tar xf 1.85.tar.gz | |
WORKDIR /opt/cppcheck/cppcheck-1.85/build | |
RUN cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/opt/cppcheckresult .. | |
RUN make -j$(nproc) |
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 <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <string> | |
#include <vector> | |
template<typename C> | |
void pr(C const&c) | |
{ | |
for (auto const& e : c) |
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
template<class T, int ... X> | |
T pi(T(X...)); | |
#include <iostream> | |
void foo() { std::cout << __LINE__ << '\n'; } | |
void foo(int) { std::cout << __LINE__ << '\n'; } | |
template<typename T> void foo(T) { std::cout << __LINE__ << '\n'; } | |
template<> void foo(int) { std::cout << __LINE__ << '\n'; } | |
template<typename T>void foo(T *) { std::cout << __LINE__ << '\n'; } |
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
tar xf ~/Downloads/cmake-3.11.1-Linux-x86_64.tar.gz -C ~/.local/ --strip-components=1 | |
or | |
tar --extract --directory=$HOME/.local --file=$HOME/Downloads/cmake-3.11.1-Linux-x86_64.tar.gz --strip-components=1 | |
I.e., tar-file content like this | |
cmake-3.11.1-Linux-x86_64/share/cmake-3.11/completions/cpack | |
cmake-3.11.1-Linux-x86_64/bin/ctest | |
cmake-3.11.1-Linux-x86_64/bin/cmake | |
cmake-3.11.1-Linux-x86_64/bin/cmake-gui |
NewerOlder