.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@9270 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-12-07 09:05:57 +00:00
parent e56810175d
commit e0ed37f067
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#include <Core/Core.h>
using namespace Upp;
void Function(const Vector<String>& h)
{
LOG("Callback invoked with " << h);
}
CONSOLE_APP_MAIN
{
Vector<String> v;
v << "Just" << "a" << "test";
Callback cb1 = callback1(Function, clone(v));
LOG("Source picked: " << v.IsPicked());
LOG("Source: " << v);
v << "2";
Callback cb2 = callback1(Function, pick(v));
LOG("Source picked: " << v.IsPicked());
cb1();
cb2();
}

View file

@ -0,0 +1,11 @@
description "Passing containers to callbacks using pick / clone\377";
uses
Core;
file
CallbackPickClone.cpp;
mainconfig
"" = "";

View file

@ -0,0 +1,4 @@
#ifndef _CallbackPickClone_icpp_init_stub
#define _CallbackPickClone_icpp_init_stub
#include "Core/init"
#endif