From ca9c1f40cad1f99f00beb2871dc50bf7222d44d4 Mon Sep 17 00:00:00 2001 From: graehl Date: Sat, 21 Aug 2010 03:07:42 +0000 Subject: agenda for fsa git-svn-id: https://ws10smt.googlecode.com/svn/trunk@612 ec762483-ff6d-05da-a07a-a48fb63a330f --- utils/null_traits.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 utils/null_traits.h (limited to 'utils/null_traits.h') diff --git a/utils/null_traits.h b/utils/null_traits.h new file mode 100755 index 00000000..fac857d9 --- /dev/null +++ b/utils/null_traits.h @@ -0,0 +1,26 @@ +#ifndef NULL_TRAITS_H +#define NULL_TRAITS_H + +template +struct null_traits { + static V null; //TODO: maybe take out default null and make ppl explicitly define? they may be surprised that they need to when they include a header lib that uses null_traits +}; +// global bool is_null(V const& v) + +// definitely override this, and possibly set_null and is_null. that's the point. +template +V null_traits::null; +//TODO: are we getting single init of the static null object? + +template +void set_null(V &v) { + v=null_traits::null; +} + +template +void is_null(V const& v) { + return v==null_traits::null; +} + + +#endif -- cgit v1.2.3