Code Monkey home page Code Monkey logo

Comments (4)

iltommi avatar iltommi commented on August 12, 2024

This is only possible in c++0x (which is still unavaible in the basic g++ os osx)

this doesn't compile on osx (you need a decent compiler)

#include
unsigned char * allocateandfill (int n) {
unsigned char *p=new unsigned char[n] {'\x01','\x02'};
return p;
}

int main () {
int n=100;
unsigned char *p=allocateandfill(n);
for (int i=0;i<n;i++) {
std::cerr << i << "\t" << (int)p[i] << std::endl;
}
}

from neutrino.

iltommi avatar iltommi commented on August 12, 2024

ok it seems to be possible using macports, but you have to do this:
sudo port select --list gcc
sudo port select --set gcc mp-gcc48

and -std=c++11 flag should be turned on

from neutrino.

iltommi avatar iltommi commented on August 12, 2024

In fact qmake wants to build with system gcc...
so you need to hack the neutrino.pri to force new compiler and this break the compilation (probably because QT is built upon gcc4.2)

and add these to neutrino.pri to tackle the default qmake definitions

QMAKE_CC = gcc
QMAKE_CXX = g++
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX

worth the candle?

from neutrino.

iltommi avatar iltommi commented on August 12, 2024

done with memcpy

from neutrino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.