forked from facebook/kuduraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basictypes.h
32 lines (26 loc) · 922 Bytes
/
basictypes.h
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
// Copyright 2001 - 2003 Google, Inc.
//
// Google-specific types
#ifndef BASE_BASICTYPES_H_
#define BASE_BASICTYPES_H_
#include "kudu/gutil/integral_types.h"
#include "kudu/gutil/macros.h"
// Argument type used in interfaces that can optionally take ownership
// of a passed in argument. If TAKE_OWNERSHIP is passed, the called
// object takes ownership of the argument. Otherwise it does not.
enum Ownership {
DO_NOT_TAKE_OWNERSHIP,
TAKE_OWNERSHIP
};
// Used to explicitly mark the return value of a function as unused. If you are
// really sure you don't want to do anything with the return value of a function
// that has been marked WARN_UNUSED_RESULT, wrap it with this. Example:
//
// scoped_ptr<MyType> my_var = ...;
// if (TakeOwnership(my_var.get()) == SUCCESS)
// ignore_result(my_var.release());
//
template<typename T>
inline void ignore_result(const T&) {
}
#endif // BASE_BASICTYPES_H_