From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amos Bird Subject: Re: evaluate cpp snippet in org babel with default includes and customized entry point Date: Sat, 16 Sep 2017 17:14:00 +0800 Message-ID: <87377n9faf.fsf@gmail.com> References: <877ewz9j4x.fsf@gmail.com> <59BCE1F6.3060406@free.fr> <8760cj9gz2.fsf@gmail.com> <59BCE6DA.80907@free.fr> <874ls39fzi.fsf@gmail.com> <59BCEAB2.3020708@free.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dt9As-0006X6-4S for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dt9Aq-0001L0-RI for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:14:06 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:53175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dt9Aq-0001Kh-L0 for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:14:04 -0400 Received: by mail-pf0-x22b.google.com with SMTP id p87so2587947pfj.9 for ; Sat, 16 Sep 2017 02:14:04 -0700 (PDT) In-reply-to: <59BCEAB2.3020708@free.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Thierry Banel Cc: "emacs-orgmode@gnu.org >> Org Mode" --=-=-= Content-Type: text/plain #+OPTIONS: latex:t toc:nil H:3 Hmm, is it possible to customize babel's c++ backend to achieve this? I may also want a evaluation that submits the code to online judge and returns the result. Thierry Banel writes: > You still need to explicitly call twoSum(), and that cannot be hidden. > > On 16/09/2017 10:58, Amos Bird wrote: > > Ok, i get the idea. So how can I customized the default code expansion so that it can directly evaluate this > > class Solution { > public: > vector twoSum(vector& nums, int target) { > > } > }; -- Amos Bird amosbird@gmail.com --=-=-= Content-Type: multipart/related; boundary="==-=-=" --==-=-= Content-Type: text/html

Hmm, is it possible to customize babel's c++ backend to achieve this? I may also want a evaluation that submits the code to online judge and returns the result.

Thierry Banel <tbanelwebmin@free.fr> writes:

> You still need to explicitly call twoSum(), and that cannot be hidden.
>
> On 16/09/2017 10:58, Amos Bird wrote:
>
> Ok, i get the idea. So how can I customized the default code expansion so that it can directly evaluate this
>
> class Solution {
> public:
> vector<int> twoSum(vector<int>& nums, int target) {
>
> }
> };


Amos Bird
amosbird@gmail.com

--==-=-=-- --=-=-=--