Questions tagged [coliru]

A free to use service to run live examples of code

Compile Link Run

Technically, not just limited to using C++. This tool will let you enter a text file, and then run a shell command. Standard practice is to just write up a quick SSCCE and show people your problem with real code.

Check it out!

8 questions
103
votes
2 answers

Compiler showing 'pi' symbol on error

I was testing some code on Coliru, and I got a strange output. I went down the code and could reproduce it with this simple piece of code: int main() { π } The output on g++: clang: For instance, using just pi (without the address-of)…
hlscalon
  • 7,304
  • 4
  • 33
  • 40
2
votes
1 answer

Spirit-X3 parsers stored in variable template specializations not working on Clang

I have a working Spirit-X3 parser, that can parse two closely related grammars for setting up draughts and checkers positions. I define two variable templates specializations as parsers for the two dialects of the grammar: // general variable…
TemplateRex
  • 69,038
  • 19
  • 164
  • 304
2
votes
1 answer

Why does coliru return the same values for chrono::system_clock::now().time_since_epoch()?

While testing someone else's code on coliru, I noticed that std::chrono::system_clock::now().time_since_epoch() returns the same values on multiple runs. I tested the following code with g++ and clang++ on coliru. #include #include…
Avi Ginsburg
  • 10,323
  • 3
  • 29
  • 56
0
votes
0 answers

Coliru fails to compile when is included

Coliru is failing to compile the program listed below. Follow the link for more information. This is the command used to compile g++ -std=c++20 -DNDEBUG -O3 -ftree-vectorize -Wall -Wno-unknown-pragmas -fpermissive -pedantic -pthread main.cpp Am I…
Catriel
  • 461
  • 3
  • 11
0
votes
1 answer

Why is virtual member function being called from base class instead of a subclass

I was writing a short snippet of code to figure out how I would store different template specializations into one data structure (e.g. vector). I'm aware of tuple but that's not good because I want to be able to append specializations after the…
Spidey
  • 894
  • 1
  • 13
  • 29
0
votes
1 answer

Why Clang at Coliru can't compile vector::push_back?

See it here. The program is very mundane, like that: #include std::vector bombs; int main() { bombs.push_back(42); // compile errors } The diagnostics do not make much sense to me: In file included from main.cpp:1: In file…
Öö Tiib
  • 10,809
  • 25
  • 44
0
votes
1 answer

How to use an online C++ compiler in my site

I want to create a site (or wikibook or github page) that will have runnable c++ code examples, pretty much like cppreference (that apparently is using coliru in the Run this code button). I'm trying to Google myself through this but each tutorial…
Lorah Attkins
  • 5,331
  • 3
  • 29
  • 63
0
votes
1 answer

How to compile multiple files with Coliru?

Tomorrow I have a test for a company. My files must be easy to compile with Coliru (web compiler) : http://coliru.stacked-crooked.com/ But here is my problem : "How do I use multiples files in Coliru ?" I read the Q&A but didn't succeed to do…
ReyalS
  • 83
  • 7