How "Pure" is the C++ in Photon?

I’m preparing notes for a class, and trying to be somewhat precise, so just how “pure” is the C++ that we’re coding in? Is it C++11? C++14? C++n (where n!= 11 && n!=14)? Thanks for any info.

how pure is pure?

https://gcc.gnu.org/projects/cxx-status.html#cxx11

1 Like

I’m not sure how pure it is, but I did discover that Serial.println(__cplusplus); yields 201103, so I guess that’s what they are using! Thanks for your reply …

1 Like

It’s C++11 compiled with gcc.

If you compile in Build, you can turn off the Arduino pre-processor with this pragma at the top of your file to get pure C++.

#pragma SPARK_NO_PREPROCESSOR

1 Like

Based on your reply, I got off on a slight tangent trying to understand the difference between C++ and the code I’m writing in particle.io. Maybe its just a matter of semantics, but it seems like I’m just programming in C++, but with extra functions linked in, and some preprocessing to solve problems like a lack of function prototypes and no main(). But “everyone” (including my favorite support team) talks about Wiring like it’s a separate language. Is it?

@mprogers, wiring is a platform sitting on top of C++, adding the (now) ubiquitous extensions like digitalWrite() and pinMode():

:smiley:

1 Like

Thanks – I’d read that, and that was part of my befuddlement – they write that it’s “composed of a programming language”, but I like your take – “a platform sitting on top of C++” – much better, I’m going to go with that. It’s really down to the question of precisely what is a programming language, and I’m not sure that Wiring qualifies as such.

1 Like

@mprogers, I believe the reference to “composed of a programming language” essentially states that Wiring requires such a language to exist since, as you put it, it is not a programming language in and of itself :wink: