lundi 20 avril 2015

How to release std string from memory management duties?

I have a string by value and a function that takes in a char pointer and length and when finished calls a callback which is a lambda expression provided on that function call. I want my string data to be deallocated on that callback -not when scope exits. There is no move into lambda in c++11 and current wrapper implementations I found can not be passed as void(*fun)() function arguments. Are there ways to move string or release it from its memory duties in c++11?

Aucun commentaire:

Enregistrer un commentaire