Skip to content

Instantly share code, notes, and snippets.

@elextr
Created November 2, 2023 01:19
Show Gist options
  • Save elextr/cb78f60a6b3613c901b45e4fa941025f to your computer and use it in GitHub Desktop.
Save elextr/cb78f60a6b3613c901b45e4fa941025f to your computer and use it in GitHub Desktop.
Simple project
#include <string>
class Hpp {
std::string s;
public:
Hpp(std::string&& st):s(move(st)){}
std::string str(){ return s; }
size_t size();
~Hpp(){}
};
project('Foo', 'cpp')
inc = include_directories('inc')
subdir('src')
#include <string>
#include <iostream>
#include "foo.hpp"
class Cpp {
std::string s;
public:
Cpp(std::string&& st):s(move(st)){}
std::string str(){ return s; }
size_t size();
~Cpp(){}
};
size_t Cpp::size(){
return s.size();
}
size_t Hpp::size(){
return s.size();
}
int main(){
Hpp h("foo");
Cpp c("bar");
std::cout<<"h="<<h.str()<<":"<<h.size()<<" c="<<c.str()<<":"<<c.size()<<std::endl;
return 0;
}
executable('foo', 'foo.cpp', include_directories: inc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment