Commit 289db61
committed
Introduce constexpr for the XBeeAddress64 constructors
This allows the compiler to better optimize (global) XBeeAdress64
instances.
With the examples sketches, this saves between 44 and 114 bytes of
program space, compiling for the Uno. Even sketches that do not directly
use any addresses shrink, because the initialization of
RemoteAtCommandRequest::broadcastAddress64 can be simplified.
This feature requires C++11 to be enabled. This isn't currently the case
(with Arduino 1.6.4), but is expected to be enabled in a future release.
A preprocessor check is used to ensure that the code compiles with and
without C++11.1 parent 50ef472 commit 289db61
1 file changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
| |||
287 | 301 | | |
288 | 302 | | |
289 | 303 | | |
290 | | - | |
| 304 | + | |
291 | 305 | | |
292 | 306 | | |
293 | 307 | | |
| |||
299 | 313 | | |
300 | 314 | | |
301 | 315 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
| |||
0 commit comments