<div>
                    Hi,
                </div><div><br></div><div>Sorry, but I'm not sure I understand what you're trying to do. I guess you want some kind of superclass of some set of classes that are defined in the llvm api(?). In that case, which are specifically the types you could have in this list you're trying to define?</div>
                <div><div><br></div><div>-- </div><div>Cristianno Martins</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Tuesday, 16 de April de 2013 at 04:22, B B wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div dir="ltr"><div>Thank you for your answer!<br></div><div><br></div><div>You are right, but I still don't know how to build such a list dynamically using LLVM API with user type inside (I don't know this type yet ofc). </div>
</div><div><br><br><div>2013/4/15 Cristianno Martins <span dir="ltr"><<a href="mailto:cristiannomartins@gmail.com" target="_blank">cristiannomartins@gmail.com</a>></span><br><blockquote type="cite"><div>

                <div>Hi,</div><div><br></div><div>
                    I guess you could use a template with a std::vector: you don't need to define right away the type, if you create a template of it.
                </div><div><br></div><div>It should look something like that:</div><div><br></div><div>template<class B> class List {</div><div>std::vector<B> myList;</div><div>void insert (int pos, B elem);</div>
<div>}</div><div><br></div><div>template <class B> </div><div>void List::add (int pos, B elem) { </div><div>  myList.insert(myList.begin()+pos, elem);</div><div>}</div>
                <div><div><br></div><div>Then, wherever you'll use this class, you should define for which class B your class List should match (such as "List<int> intList;" or "List< std::vector<long> > longVectors;").</div>
<div><br></div><div>-- </div><div>Cristianno Martins</div></div><div><div>
                  
                <p style="color:#a0a0a8">On Monday, 15 de April de 2013 at 07:13, B B wrote:</p>
                </div></div><blockquote type="cite"><div>
                    <span><div><div><div><div><div>Hi!</div><div>I want to implement a list (which operates like ArrayList in Java).</div><div><br></div><div>I can use ArrayType from llvm, but at creation time I have to specify</div>
<div>size so there is a problem when I want to extend it (I can reallocate</div><div>it ofc). Moreover I need to implement all the operations (inserting,</div><div>removing etc.) manually.</div><div><br></div><div>I though that maybe I can use std::vector, but there is another</div>
<div>problem - std::vector is a template class, so I have to specify type</div><div>before compiling it to llvm bytecode. Is there some solution to</div><div>specify that type dynamically?</div><div><br></div><div>What is the best method to implement such things in llvm?</div>
<div><br></div><div>I would be grateful for any solutions or tips.</div></div></div><div>_______________________________________________</div><div>LLVM Developers mailing list</div><div><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a></div>
<div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></div></div></span>
                  
                  
                  
                  
                </div></blockquote><div>
                    <br>
                </div>
            </div></blockquote></div><br></div>
</div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>