You may further hide the includes with a property drawer. An additional
benefit is that those includes are shared among all babels under the
same section.
* Example
:PROPERTIES:
:includes: <iostream> <vector>
:END:
#+BEGIN_SRC C++
std::cout<<"hello";
#+END_SRC
#+RESULTS:
: hello
On 16/09/2017 10:54, Thierry Banel wrote:
You may use the :includes header parameter.
Also, you may omit the main() function. In this case, all your code
will become the body of a default main function. Type C-c C-v v on the
following example to understand what is happening.
#+BEGIN_SRC C++ :includes <iostream>
std::cout<<"hello";
#+END_SRC
#+RESULTS:
: hello
On 16/09/2017 10:37, Amos Bird wrote:
Thanks Thierry,
But I'd like to hide all those includes and the main function. I'm
not sure if it's possible.