File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #ifdef ARDUINO
2- #include < streamFlow.h>
3- using namespace StreamFlow ;
4- #define cout Serial
5- #define endl " \n "
6- #else
7- #include < iostream>
8- using namespace std ;
9- #endif
10-
111#include < hapi.h>
122using namespace hapi ;
133
@@ -16,7 +6,7 @@ using Year=Parts<StaticInt<1967>,Nil>;
166const char * label=" label:" ;
177NilPart<StaticText<label>,ReflexOf,FieldValue<Int>> year{2025 };
188
19- int main () {
9+ void run () {
2010 cout<<Year::get ()<<endl;
2111
2212 cout<<year.changed ()<<endl;
@@ -26,6 +16,20 @@ int main() {
2616 cout<<year.getValue ()<<endl;
2717
2818 cout<<year<<endl;
29- cout<<CanPrint<Year>::value<<endl;
30- return 0 ;
31- }
19+ }
20+
21+ #ifdef ARDUINO
22+ void setup () {
23+ Serial.begin (115200 );
24+ while (!Serial);
25+ }
26+ void loop () {
27+ run ();
28+ delay (500 );
29+ }
30+ #else
31+ int main () {
32+ run ();
33+ return 0 ;
34+ }
35+ #endif
Original file line number Diff line number Diff line change 11#pragma once
22
3+ #ifdef ARDUINO
4+ #include < Arduino.h>
5+ #endif
6+
7+ #ifdef __AVR__
8+ #include < streamFlow.h>
9+ using namespace StreamFlow ;
10+ #define cout Serial
11+ #define endl " \n "
12+ #else
13+ #include < iostream>
14+ using std::cout;
15+ using std::endl;
16+ #endif
17+
318#ifdef __AVR__
419 #include " hapi/platform/avr/avr_std.h"
520 using avr_std::enable_if;
1833 using std::is_class;
1934 using std::forward;
2035 using std::remove_reference;
36+ using std::operator <<;
2137#endif
2238
2339template <bool chk,typename T=void > using When=typename enable_if<chk,T>::type;
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include " hapi/parts .h"
3+ #include " hapi/base .h"
44
55namespace hapi {
66 template <typename T,bool > struct _CanPrint ;
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include " hapi/base .h"
3+ #include " hapi/canPrint .h"
44
55namespace hapi {
66 template <typename T,T data>
@@ -9,7 +9,7 @@ namespace hapi {
99 struct Part :O {
1010 template <typename ... OO> constexpr Part (OO... oo):O{oo...}{}
1111 static constexpr const T get () {return data;}
12- template <typename Out> Out& operator <<(Out& out) const {out<< data;O::operator <<(out);return out;}
12+ template <typename Out> Out& operator <<(Out& out) const {:: operator <<(out, data) ;O::operator <<(out);return out;}
1313 };
1414 };
1515
You can’t perform that action at this time.
0 commit comments