aboutsummaryrefslogtreecommitdiff
path: root/src/tests/fstratsptr.cpp
blob: 61c20bd1ff37ab22cdd469ce92e32004cd5439a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "bu/fstring.h"
#include "bu/atom.h"
#include "bu/sptr.h"

class Person
{
public:
	Person(){};
	virtual ~Person(){};

	Bu::Atom<Bu::FString> sFirstName;
	Bu::Atom<Bu::FString> sLastName;
};

typedef Bu::SPtr<Person> PersonPtr;

void Swap(PersonPtr one, PersonPtr two)
{
	PersonPtr three(new Person);
	three->sFirstName = one->sFirstName;
	three->sLastName = two->sLastName;

	printf(
			"%s %s\n",
			three->sFirstName->getStr(),
			three->sLastName->getStr() );
}

int main()
{
/*	PersonPtr one(new Person);
	PersonPtr two(new Person);
	one->sFirstName = "Bob";
	one->sLastName = "Smith";
	two->sFirstName = "Fred";
	two->sLastName = "Carpenter";

	Swap(one, two);
*/

	Bu::Atom<Bu::FString> sOne, sTwo;
	sOne = "Hello";
	sTwo = sOne;

	return 0;
}