1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/public/cpp/bindings/tests/container_test_util.h"
9 size_t CopyableType::num_instances_ = 0;
10 size_t MoveOnlyType::num_instances_ = 0;
12 CopyableType::CopyableType() : copied_(false), ptr_(this) {
16 CopyableType::CopyableType(const CopyableType& other)
17 : copied_(true), ptr_(other.ptr()) {
21 CopyableType& CopyableType::operator=(const CopyableType& other) {
27 CopyableType::~CopyableType() {
31 MoveOnlyType::MoveOnlyType() : moved_(false), ptr_(this) {
35 MoveOnlyType::MoveOnlyType(RValue other)
36 : moved_(true), ptr_(other.object->ptr()) {
40 MoveOnlyType& MoveOnlyType::operator=(RValue other) {
42 ptr_ = other.object->ptr();
46 MoveOnlyType::~MoveOnlyType() {