Skip to content

Instantly share code, notes, and snippets.

@ObjectBoxPC
Last active September 5, 2024 22:13
Show Gist options
  • Save ObjectBoxPC/1e965db5fda2fc9e31659ae8e328be94 to your computer and use it in GitHub Desktop.
Save ObjectBoxPC/1e965db5fda2fc9e31659ae8e328be94 to your computer and use it in GitHub Desktop.
Misusing C++ alternative tokens
#include <utility>
class my_class {
public:
compl my_class() {} // Destructor
};
int main() {
my_class example_obj;
my_class bitand example_ref = example_obj;
my_class and example_rvalue_ref = std::move(example_obj);
my_class *example_ptr = bitand example_obj;
}
@ObjectBoxPC
Copy link
Author

I wrote a blog post with some more background on these tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment