Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit e84a333

Browse files
committed
move exception_with_errormsg to pexceptions.hpp
to minimize dependencies of common.hpp
1 parent 15bd7d9 commit e84a333

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/libpmemobj++/detail/common.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@ static constexpr size_t CACHELINE_SIZE = 128ULL;
159159
#error unable to recognize architecture at compile time
160160
#endif
161161

162-
/**
163-
* Generic error message decorator for pmemobj-based exceptions.
164-
*/
165-
template <class ExcT, typename MsgT>
166-
ExcT
167-
exception_with_errormsg(const MsgT &msg)
168-
{
169-
return ExcT(msg + std::string(": ") + detail::errormsg());
170-
}
171-
172162
/**
173163
* Conditionally add 'count' objects to a transaction.
174164
*

include/libpmemobj++/pexceptions.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ errormsg(void)
3434
return std::string(pmemobj_errormsg());
3535
#endif
3636
}
37+
38+
/**
39+
* Generic error message decorator for pmemobj-based exceptions.
40+
*/
41+
template <class ExcT, typename MsgT>
42+
ExcT
43+
exception_with_errormsg(const MsgT &msg)
44+
{
45+
return ExcT(msg + std::string(": ") + detail::errormsg());
46+
}
3747
} /* namespace detail */
3848

3949
/**

0 commit comments

Comments
 (0)