Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Tomy Hudson
std::string& arguments [ reply ]  
2008-06-19 21:49

I understand that there can't be a standard conversion for this, since it is a reference. But I find myself duplicating code like this:

Object set_data_layout(Object self, String value)
{
llvm::Module* m = from_ruby<llvm::Module>(self);
std::string v = value.str();
m->setDataLayout(v); // takes a const std::string&
return value;
}

Are there any other methods for wrapping methods that take string references?