similar to: Any way to avoid instantiating a class twice?

Displaying 20 results from an estimated 7000 matches similar to: "Any way to avoid instantiating a class twice?"

2007 Jan 15
6
Instantiating middleman and worker from inside a model?
In short: how (if possible) would i go about arranging it so that i can instantiate a middleman and set a worker going from within a method in one of my models? or is this a weird thing to be wanting to do? ( My specific situation: I have an ''Image'' model in my application. An actual image file associated with the model is being stored on amazons s3 system.
2012 May 04
1
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
Hello, I am working on a tool which takes c++ header files and based on interfaces defined in them generates csharp classes and glue layer for interop. For analyzing the c++ code I am currently using clang, which parses the headers and writes output into xml via -ast-print-xml (yes, this unfortunately means that it is a very old version of clang). I then use these xml files to generate the csharp
2009 Dec 04
4
[LLVMdev] r72619
On Dec 4, 2009, at 12:40 PM, Duncan Sands wrote: > Hi Bill, > >> Here's what I get with TOT compiling with -Os. The orig.ll is what >> I get before r72619. Notice that orig.ll has only one function in >> it. Both the one you sent and duncan.ll have more than one >> function. It's not the fact that more than one function is showing >> up, but
2018 Jul 10
2
Is it really valid to discard externally instantiated functions from a TU when marked inline?
Hi, While investigating the situation of visibility annotations and linkage in libc++ with the goal of removing uses of `__always_inline__`, Eric Fiselier and I stumbled upon the attached test case, which I don't think Clang compiles properly. Here's the gist of the test case, reduced to the important parts (see the attachment if you want to repro): // RUN: %cxx -shared -o
2009 Dec 04
0
[LLVMdev] r72619
>> > Only "_Z11dummysymbolv" should be there. Here's Doug's explanation of > why this should be so: > > Here's what it *looks* like is happening, and where the FE is probably > getting it wrong. First of all, the constructor in question is defined > outside of the basic_string class template as a non-inline definition: > >
2016 Oct 20
2
RFC: Killing undef and spreading poison
Hi Mehdi, On Wed, Oct 19, 2016 at 8:29 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: >> sext(x): >> t = zext x >> result = 0 >> for i = 0 to bitwidth: >> result |= t << i; >> return result > > I don’t understand this definition of sext? > Are you trying to express that we will copy the sign one bit at a time, and so every `new`
2010 Mar 08
0
Instantiating Controller Object on Rails3 for unit testing
Dear all, I am experiencing this error when doing unit testing: Authlogic::Session::Activation::NotActivatedError: You must activate the Authlogic::Session::Base.controller with a controller object before creating objects I know this is not an error from Rails but I encounter this when doing unit testing in Rails. This error happenned because my model has dependencies to 3rd Party library named
2012 Sep 29
0
[LLVMdev] Clang bug?
This doesn't appear to me to be the same issue (but of course I don't know clang as well as you all do). This code appears invalid (and G++ rejects it with a similar "no type named ..." error message), whereas the original code is valid C++ (both C++98 and C++11). On Fri, Sep 28, 2012 at 3:54 PM, Richard Smith <richard at metafoo.co.uk> wrote: > Reduced testcase: >
2012 Sep 28
4
[LLVMdev] Clang bug?
Reduced testcase: template<typename T> struct A { typedef decltype(T() + 0) type; }; template<typename T> struct B { struct C { typedef typename A<C*>::type type; }; typedef typename A<C*>::type type; }; B<int> b; ... produces ... <stdin>:3:38: error: no type named 'type' in 'A<B<int>::C *>' struct C { typedef typename
2012 Sep 29
1
[LLVMdev] Clang bug?
On Fri, Sep 28, 2012 at 5:11 PM, Adam Peterson <alpha.eta.pi at gmail.com>wrote: > This doesn't appear to me to be the same issue (but of course I don't > know clang as well as you all do). This code appears invalid (and G++ > rejects it with a similar "no type named ..." error message), whereas > the original code is valid C++ (both C++98 and C++11). [The
2012 May 08
0
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
My gut tells me that if it isn't already available, then it will be difficult as the instantiation has to occur for the final compilation, but that must be occurring in a later phase of compilation than the one where the XML file is generated. Their is also a good chance that the instantiation depends on information that isn't available until after the XML file is generated (things like
2010 Aug 16
3
R with CouchDB?
Hello all, I'm kind of surprised that searching the archives and Googling haven't given me a result for this... I've got a large amount of data that is a good fit for CouchDB; it's reasonably unstructured, and such structure that exists is quite fluid. I want to slice the data in many different ways, some of which really don't fit well with a relational database model. I
2012 May 07
0
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
Is the original definition of the template available in the XML file, not just the reference to the specific instantiations (i.e. IMyEnumerator<int>). On Mon, May 7, 2012 at 12:08 PM, Ondrej Kolacek <natris1 at gmail.com> wrote: > (another try from different mail account; I hope I was able to clarify > my issue better. ) > > Hello, > I am working on a tool which takes
2016 Oct 20
2
RFC: Killing undef and spreading poison
Hi Alexandre, On Wed, Oct 19, 2016 at 6:27 PM, Alexandre Isoard <alexandre.isoard at gmail.com> wrote: > Really interesting read. I am perplexed now, and am not even sure what is > the meaning of undef anymore. Welcome aboard. :) > Example (unrelated to your blog post, but still weird): > %x = sext i1 undef to i2 > > I understand that I can replace it by either of: >
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to dump the DB, modify the table''s structure, then go and modify EVERY insert statement. The insert statements look like (from memory): INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''', ''some_other
2009 Dec 04
2
[LLVMdev] r72619
On Dec 4, 2009, at 12:52 AM, Duncan Sands wrote: > Hi Bill, > >> There's a problem with your check-in for r72619 is causing "weak >> external" symbols to appear in C++ code when it shouldn't. Take >> this code for example, >> #include <stdexcept> >> void dummysymbol() { >> throw(std::runtime_error("string"));
2009 Dec 04
0
[LLVMdev] r72619
Hi Bill, > Here's what I get with TOT compiling with -Os. The orig.ll is what I get > before r72619. Notice that orig.ll has only one function in it. Both the > one you sent and duncan.ll have more than one function. It's not the > fact that more than one function is showing up, but these functions in > particular shouldn't be there because of the implicit/explicit
2012 Sep 29
0
[LLVMdev] Clang bug?
On Sep 28, 2012, at 5:54 PM, Richard Smith <richard at metafoo.co.uk> wrote: > Reduced testcase: > > template<typename T> struct A { typedef decltype(T() + 0) type; }; > template<typename T> struct B { > struct C { typedef typename A<C*>::type type; }; > typedef typename A<C*>::type type; > }; > B<int> b; > > ... produces ...
2007 Nov 29
2
[LLVMdev] LLVM on MinGW
Antony Blakey wrote: > SVN head LLVM and Clang built out of the box for me a week ago on > MSYS/MINGW, using the following files: Ok, I tried to do the same. The compilations stops with the following error message (actually, I got to the same point in my attempt to build LLVM with the MinGW compiler shipped with Cygwin): llvm[1]: Compiling MachineLoopInfo.cpp for Debug build
2013 Sep 05
0
[LLVMdev] [ast-dump] Class template partial specializations missing from an implicit class template instantiation?
I was looking at the ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember documentation, in the included example it says: "(..) the instantiation of Outer<float>::Inner<int*> will end up instantiating the partial specialization Outer<float>::Inner<U*> (...)". To understand the concept better, I dumped the AST for the following code: