~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Kernel/Containers/promise.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2010-04-23 07:09:40 UTC
  • mfrom: (1.2.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20100423070940-juy8n05xs1b6au8i
Re-upload, former upload failed with wrong diff.gz perhaps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
class tree;
17
17
template<class T> class promise_rep;
18
18
template<class T> class promise;
19
 
template<class T> ostream& operator << (ostream& out, promise<T> cmd);
 
19
template<class T> tm_ostream& operator << (tm_ostream& out, promise<T> cmd);
20
20
template<class T> bool is_nil (promise<T> l);
21
21
 
22
22
template<class T>
24
24
public:
25
25
  inline promise_rep () {}
26
26
  inline virtual ~promise_rep () {}
27
 
  inline virtual ostream& print (ostream& out);
 
27
  inline virtual tm_ostream& print (tm_ostream& out);
28
28
  virtual T eval () = 0;
29
29
};
30
30
 
33
33
public:
34
34
ABSTRACT_NULL_TEMPLATE(promise,T);
35
35
  inline T operator () ();
36
 
  friend ostream& operator << LESSGTR (ostream& out, promise<T> cmd);
 
36
  friend tm_ostream& operator << LESSGTR (tm_ostream& out, promise<T> cmd);
37
37
};
38
38
ABSTRACT_NULL_TEMPLATE_CODE(promise,class,T);
39
39
 
40
40
#define TMPL template<class T>
41
 
TMPL inline ostream& promise_rep<T>::print (ostream& out) {
 
41
TMPL inline tm_ostream& promise_rep<T>::print (tm_ostream& out) {
42
42
  return out << "promise"; }
43
43
TMPL inline T promise<T>::operator () () {
44
44
  return rep->eval (); }
45
45
TMPL inline bool operator == (promise<T> mw1, promise<T> mw2) {
46
46
  return mw1.rep == mw2.rep; }
47
 
TMPL inline ostream& operator << (ostream& out, promise<T> cmd) {
 
47
TMPL inline tm_ostream& operator << (tm_ostream& out, promise<T> cmd) {
48
48
  if (is_nil (cmd)) return out << "(null)"; else return cmd->print(out); }
49
49
#undef TMPL
50
50