Last active
August 8, 2016 00:29
-
-
Save oschulz/0fe9890da85931e87fd1dd5cbf311d15 to your computer and use it in GitHub Desktop.
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
using Cxx | |
cxx""" | |
#include <iostream> | |
class MyClass { | |
public: | |
int i = 0; | |
MyClass() { std::cerr << "INFO: MyClass()" << std::endl; } | |
MyClass(int j) : i(j) { std::cerr << "INFO: MyClass(" << i << ")" << std::endl; } | |
MyClass(const MyClass &other) { std::cerr << "INFO: MyClass()" << std::endl; } | |
~MyClass() { std::cerr << "INFO: ~MyClass()" << std::endl; } | |
}; | |
""" | |
a = @cxx MyClass(42) | |
b = icxx""" MyClass(43); """ | |
info("Objects constructed: $a, $b") | |
info("Stack allocated: $(isbits(a)), $(isbits(b))") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment