PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libpolybori
include
polybori
common
CCheckedIdx.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
14
//*****************************************************************************
15
16
#ifndef polybori_common_CCheckedIdx_h_
17
#define polybori_common_CCheckedIdx_h_
18
19
// include basic definitions
20
#include <
polybori/pbori_defs.h
>
21
22
BEGIN_NAMESPACE_PBORI
23
29
class
CCheckedIdx
:
30
public
CTypes::auxtypes_type
{
31
33
typedef
CCheckedIdx
self
;
34
35
public
:
36
CCheckedIdx
(
idx_type
idx): m_idx(idx) {
37
if
PBORI_UNLIKELY
(idx < 0) handle_error();
38
}
39
CCheckedIdx
(
const
self
& rhs): m_idx(rhs.m_idx) { }
40
~CCheckedIdx
() {}
41
42
operator
idx_type
()
const
{
return
m_idx; }
43
private
:
44
void
handle_error()
const
;
45
idx_type
m_idx;
46
};
47
48
END_NAMESPACE_PBORI
49
50
#endif
Generated by
1.8.3.1