Skip to content

Instantly share code, notes, and snippets.

View ctor_init_list_fallacy.cpp
#include <stdio.h>
class Component
int value;
Component(int v) :
martinky /
Last active Mar 26, 2020
Minimal example simulating a JS closure capture bug of the QML engine that is only observed while the QML debugger is attached. With the QML debugger attached following error occurs: main.qml:30: ReferenceError: text is not defined. Without QML debugger attached, the code works properly.
QT += quick
CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc
martinky / dummy.h
Last active Mar 23, 2021
Dummy helper struct that helps to debug when C++ objects get created, copied and destroyed.
View dummy.h
#pragma once
Dummy struct that prints a line whenever it is constructed, copied, moved or destructed.
struct dummy {
int val;
dummy() : val(0) { printf("dummy() def ctor\n"); }
dummy(int v) : val(v) { printf("dummy(%d) ctor\n", val); }
dummy(const dummy &d) : val(d.val) { printf("dummy(%d) copy ctor\n", val); }
martinky / Makefile
Last active Mar 18, 2022
Makefile used to run complete Ansible playbooks in parallel on individual hosts using make -jN with added timeout constraint.
View Makefile
HOSTS=host_a host_b
deploy: all_hosts
all_hosts: $(HOSTS)