Fixed network error, leaving try block in place for the time being
It seems that the union type Packet didn't initialize Packet::type to PacketType::NONE using in class initialization. I've fixed this by moving the initialization of Packet::type to Packet::Packet(). This might actually be a compiler error, I might need to let someone know.
This commit is contained in:
+3
-11
@@ -1,19 +1,11 @@
|
||||
#include "packet_type.hpp"
|
||||
#include "service_locator.hpp"
|
||||
#include "foobar.hpp"
|
||||
|
||||
#include "vector2.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
ServiceLocator<int>::Set(new int(42));
|
||||
ServiceLocator<Packet>::Set(new Packet());
|
||||
|
||||
cout << FooBar() << endl;
|
||||
|
||||
ServiceLocator<int>::Set(nullptr);
|
||||
ServiceLocator<Packet>::Set(nullptr);
|
||||
Packet p;
|
||||
cout << int(p.type) << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user