Last active
January 10, 2017 08:55
-
-
Save titouancreach/4a7c7ac215cebd79a82f92808ceed695 to your computer and use it in GitHub Desktop.
Plus besoin de fonction init !
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
#include <iostream> | |
#include <cstdlib> | |
typedef int handle_type; | |
namespace uEye | |
{ | |
class uEye | |
{ | |
public: | |
handle_type getCamera() { return 1; } | |
}; | |
class Memory | |
{ | |
public: | |
Memory() = default; | |
Memory(Memory&& rhs) = default; // mv | |
Memory& operator=(Memory&& rhs) = default; | |
Memory& operator=(const Memory& rhs) = delete; // cpy | |
Memory(const Memory& rhs) = delete; | |
Memory(const handle_type& camera) : m_camera(camera) | |
{} | |
handle_type m_camera = { -1 }; | |
}; | |
} | |
int main(int argc, char** argv) | |
{ | |
uEye::uEye uEye; | |
uEye::Memory memory; // constructeur par défaut | |
std::cout << memory.m_camera << std::endl; // -1 (objet non construit) | |
memory = uEye.getCamera(); // operator=(&&) | |
std::cout << memory.m_camera << std::endl; // 1 (objet construit et utilisable) | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment