Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <functional>
- #include <cmath>
- void Example1() {}
- bool Example2() { return true; }
- bool* Example3() { return new bool(true); }
- std::function<void()> Example4 = []() {};
- std::function<bool()> Example5 = []() { return true; };
- std::function<bool*()> Example6 = []() { return new bool(true); };
- bool Example7(false);
- bool* Example7Pointer = &Example7;
- const bool Example8(false);
- const bool* const Example8Pointer = &Example8;
- class Textable {
- public:
- virtual std::string ToText();
- };
- class Vector : public Textable {
- public:
- float X = 0.0f;
- float Y = 0.0f;
- Vector(const float* x, const float* y) {
- X = *x;
- Y = *y;
- }
- std::string ToText() {
- return "X: " + std::to_string(X) + ", Y: " + std::to_string(Y);
- }
- };
- int main() {
- float x(2.4f);
- float y(8.7f);
- Vector vector(&x, &y);
- std::cout << vector.ToText() << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement