source: launchers/macosx/include/traits.hpp @ beede950

Last change on this file since beede950 was beede950, checked in by meeh <meeh@…>, 3 years ago

Preparing for XCode project. Removing now obsolete files.

  • Property mode set to 100644
File size: 961 bytes
Line 
1#ifndef NEITHER_TRAITS_HPP
2#define NEITHER_TRAITS_HPP
3
4namespace neither {
5
6template<class L, class R>
7struct Either;
8
9template<class T>
10struct Maybe;
11
12template<class L,class...Xs>
13auto isCopyable (L l, Xs...) -> L {
14  return l;
15}
16
17template<class L, class R>
18auto ensureEither ( Either<L,R> const& e) -> Either<L,R> {
19  return e;
20}
21
22template<class L, class R>
23auto ensureEither ( Either<L,R> && e) -> Either<L,R> {
24  return e;
25}
26
27template<class L, class R>
28auto ensureEitherRight ( Either<L,R> const& e, R) -> Either<L, R> {
29  return e;
30}
31
32
33template<class L, class R>
34auto ensureEitherRight ( Either<L,R>&& e, R&&) -> Either<L, R> {
35  return e;
36}
37
38
39template<class L, class R>
40auto ensureEitherLeft ( Either<L,R> const& e, L) -> Either<L, R> {
41  return e;
42}
43
44template<class L, class R>
45auto ensureEitherLeft ( Either<L,R>&& e, L&&  ) -> Either<L, R> {
46 return e;
47}
48
49
50template<class T>
51auto ensureMaybe ( Maybe<T> const& e) -> Maybe<T> {
52  return e;
53}
54
55}
56
57#endif
Note: See TracBrowser for help on using the repository browser.