I'm trying to access the object (called a Vector) pointed to by a pointer held in a vector container, but I can't seem to get to it.
Here are the important code snippets:
int main{
Vector<double>* test = new Vector<double>(randvec<double>());
test->save();
cout << Element::vectors[0];
return 0;
}
Where Vector is a templ...
We all know that things like this are valid in c++:
const T &x = T();
while:
T &x = T();
is not.
In a recent question the conversation lead to this rule. The OP had posted some code which clearly evokes UB. But I would have expect a modified version of it to work (This is the modified version):
#include <iostream>
using namespace...
I'm trying to index the GAC and use the ResolveAssemblyReferences target. However, some assemblies (such as Unity application block) seem to be missing from the GAC and yet VS happily shows them in the Add Reference dialog. My question: how can this be? I always thought that only GAC-registered assemblies appear there. Am I missing somet...
Hi. I'm having trouble with the following sentence:
DeepClone performs a deep clone of
the target object, stopping the cloning process
when all <dependency paths> have
reached a value type or an ITransactionalObject.
What I mean by "dependency path" is the chain of references you follow in the cloning process: object A has a ...
I have scenario where my loose xaml file can contain the custom control from another assembly. How do i make a reference to that assembly. My Loose XAML and assembly are at the same path.
I know the embedded xaml or xaml with in a project, the reference is added like this:
xmlns:WpfToolKit="http://schemas.microsoft.com/wpf/2008/toolkit"...
In Perl 5.10.1:
#!/usr/bin/perl
my @a = (1, 2, 3);
my $b = \@a;
print join('', @{$b}) . "\n";
@a = (6, 7, 8);
print join('', @{$b}) . "\n";
This prints 123 then 678. However, I'd like to get 123 both times (i.e. reassigning the value of @a will not change the array that $b references). How can I do this?
...
this might be silly!!! but i am eager to know about it:)
why are reference variables not present/used in C?
why are they designed for C++?
...
I've just found something very strange in PHP.
If I pass in a variable to a function by reference, and then call a function on it, it's incredibly slow.
If you loop over the inner function call and the variable is large it can be many orders of magnitude slower than if the variable is passed by value.
Example:
<?php
function TestCoun...
I have been consuming a service for some time in development, and have been updating my service reference almost daily with no problems. Collection types have been set to generate as System.Collections.Generic.List in the Advanced options.
However, for no apparent reason, now when I update the Service Reference, it's generating Array ty...
Hi, my first question so hope it is suitable -
Shared interface assembly - I have a 'shared' assembly which has an interface, let's call it IDocRepository. It's marked with [ServiceContract] and there are several [OperationContract]-marked methods.
WCF implementation assemblies - I have two WCF service projects, each referencing the s...
i thought, that i understand what references do.
but now i meet an example, which can't understand anyway.
i saw an interesting script here, but why he use & in this script i can't understand.
here is the part of script
foreach ($nodeList as $nodeId => &$node)
{
if (!$node['id_parrent'] || !array_key_exists($node['id_parrent'], $n...
Hello, I'm using ptr_map from boost for storing objects derived from some base abstract type.
class Entity { virtual void foo() = 0; };
class Entity1 : public Entity {};
class Entity2 : public Entity {};
boost::ptr_map<string, Entity> someMap; // We could store pointers for abstract type
Inserting works great:
someMap.insert("someKe...
char *str = "Hello";
char *ptr = str;
char *&rptr = str;
What is the difference between ptr and rptr? I understand rptr is a reference to a pointer(in theory) but how does it differ in terms of implementation with ptr?
Are references in C++ implemented using pointers?
...
Hello, I'm using ptr_map for storing different types of pointers.
boost::ptr_map<string, any> someMap;
I store there some templated class objects:
someMap.insert("1", new SomeClass<int>());
someMap.insert("2", new SomeClass<float>());
Now I want to get values from map. Here is a sample with references:
template<typename T>
T &get(...
Sorry to ask, its late and I can't figure a way to do it... anyone can help?
$users = array(
array(
"name" => "John",
"age" => "20"
),
array(
"name" => "Betty",
"age" => "22"
)
);
$room = array(
"furniture" => array("table","bed","chair"),
"objects" => array("tv","radio","bo...
I'm working through installing the N2 content management framework in an ASP.NET website project.
The instructions at http://n2cms.com/Documentation/Content-enabling%20an%20existing%20site/The%20first%20content%20class.aspx recommend I create a lib folder to hold the required dlls. The very next step asks me to reference those same dlls...
Hi, i used always $text = $datasql[0];
where $datasql = array('0'=>array('some'=>'text', 'some2'=>'text2'), '1'=>$data, etc...);
and found work costruction $datasql = &$datasql[0]; and work, why?
That really reference?? and how remeber php in memory this solution.
Thanks for reaply
...
Suppose I have a method like this:
public void MyCoolMethod(ref bool scannerEnabled)
{
try
{
CallDangerousMethod();
}
catch (FormatException exp)
{
try
{
//Disable scanner before validation.
scannerEnabled = false;
if (exp.Message == "FormatException")
...
Hi guys
I've got a Problem. I need to use some classes from another Library DLL, that has been written a year ago, in my WPF Project. Therefore I reference this Library in my Project. But when I want to rebuild my solution I always get some warnings that my assembly cannot be resolved because it uses some dependencys that do not match m...
i have such code
var menu = _dataManager.Menu.Details(id);
var menu2 = _dataManager.Menu.Details(id);
menu.Name = "AAA";
in this case menu2.Name will be "AAA", i guess it because of reference, but how can i solve it?
...