Search Results

Search found 6753 results on 271 pages for 'forward declaration'.

Page 70/271 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • Allow Incorrect Package Name in Eclipse

    - by SamBeran
    I have some classes in my current project which have the wrong package declaration (they are in the wrong folder for their declared package.) Unfortunately, fixing the problem by moving the class is not an option. Is there a way I can get eclipse to ignore the error?

    Read the article

  • Haskell Tuple Size Limit

    - by SHiNKiROU
    Why I can't construct large tuples in Haskell? Why there's a tuple size limit? Prelude> (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) <interactive>:1:0: No instance for (Show (t, t1, t2, ... t23)) arising from a use of `print' at <interactive>:1:0-48 Possible fix: add an instance declaration for (Show (t, t1, t2, ... t23)) In a stmt of a 'do' expression: print it

    Read the article

  • How do I declare a constructor for an 'object' class type in Scala? I.e., a one time operation for the singleton.

    - by Zack
    I know that objects are treated pretty much like singletons in scala. However, I have been unable to find an elegant way to specify default behavior on initial instantiation. I can accomplish this by just putting code into the body of the object declaration but this seems overly hacky. Using an apply doesn't really work because it can be called multiple times and doesn't really make sense for this use case. Any ideas on how to do this?

    Read the article

  • Syntax highlighting Abbreviations

    - by Nimbuz
    I'm using Google prettify for syntax highlighting and I'd like to modify the colors to match my website theme, but I don't understand some of the abbreviations from these: str = string atw kwd = keyword tag = tag com = comment typ = type? atn dec = declaration? lit pun = punctuation? like colons, braces? pln prettyprint

    Read the article

  • recommending gcc to inline the function

    - by thetna
    I don't know how feasible it is and how sensible is this question here. Is there any changes that we can make in makefile to recommend GCC inline all the function although the functions are not inlined during the declaration or nowhere in the source file.

    Read the article

  • Including a C header which declares a variable called "new"?

    - by StackedCrooked
    I'm trying to use the OpenCA library in a C++ application. However, when including the file pki_x509_data_st.h the following code fragment is encountered: typedef struct pki_x509_callbacks_st { /* ---------------- Memory Management -------------------- */ void * (*new) (void ); void (*free) (void *x ); void * (*dup) (void *x ); This won't compile because of the "new" pointer declaration. How can I make it work?

    Read the article

  • Regarding address operator C/C++

    - by iSight
    Hi, What does address operator mean. say in the method below. what should be passed in the method as parameter value of integer or the address of an integer variable. void func1(int&)// method declaration void func1(int& inNumber)//method definition { //some code }

    Read the article

  • Overriding inherited generic methods

    - by jess
    I have this code in base class protected virtual bool HasAnyStuff<TObject>(TObject obj) where TObject:class { return false; } In child class I am overriding protected override bool HasAnyStuff<Customer>(Customer obj) { //some stuff if Customer.sth etc return false; } I am getting this error '''Type parameter declaration must be an identifier not a type''' What is it I am doing wrong here?

    Read the article

  • Skipp default parameters in Delphi

    - by Vijay Bobba
    Hi Is there any way to skip the default params, say suppose my method declaration is like this: procedure Myfunc1(var isAttr1: Boolean = FALSE; isAttr2: Boolean = FALSE; isAttr3: Boolean = FALSE); I can't call the function like this: Self.Myfunc1( , , Attr3); because I don't want unnecessary var declarations, at the same time I want the last param return value (it is a var type) Thank for help in advance

    Read the article

  • Struct inside a class

    - by Balakrishnan
    I have a class definition of the form class X { public: //class functions private: A_type *A; //other class variables }; and struct A_type is defined as struct A_type { string s1,s2,s3; }; Inside the constructor, I allocate appropriate memory for A and try A[0].s1="somestring"; It shows segmentation fault. Is this kind of declaration invalid, or am I missing something

    Read the article

  • malloc in kernel

    - by yoavstr
    when i try to malloc at kernel mod i get screamed by the compiler : res=(ListNode*)malloc(sizeof(ListNode)); and the compiler is screaming : /root/ex3/ex3mod.c:491: error: implicit declaration of function ‘malloc’ what should i do ?

    Read the article

  • Templated derived class in CRTP (Curiously Recurring Template Pattern)

    - by Butterwaffle
    Hi, I have a use of the CRTP that doesn't compile with g++ 4.2.1, perhaps because the derived class is itself a template? Does anyone know why this doesn't work or, better yet, how to make it work? Sample code and the compiler error are below. Source: foo.C #include <iostream> using namespace std; template<typename X, typename D> struct foo; template<typename X> struct bar : foo<X,bar<X> > { X evaluate() { return static_cast<X>( 5.3 ); } }; template<typename X> struct baz : foo<X,baz<X> > { X evaluate() { return static_cast<X>( "elk" ); } }; template<typename X, typename D> struct foo : D { X operator() () { return static_cast<D*>(this)->evaluate(); } }; template<typename X, typename D> void print_foo( foo<X,D> xyzzx ) { cout << "Foo is " << xyzzx() << "\n"; } int main() { bar<double> br; baz<const char*> bz; print_foo( br ); print_foo( bz ); return 0; } Compiler errors foo.C: In instantiation of ‘foo<double, bar<double> >’: foo.C:8: instantiated from ‘bar<double>’ foo.C:30: instantiated from here foo.C:18: error: invalid use of incomplete type ‘struct bar<double>’ foo.C:8: error: declaration of ‘struct bar<double>’ foo.C: In instantiation of ‘foo<const char*, baz<const char*> >’: foo.C:13: instantiated from ‘baz<const char*>’ foo.C:31: instantiated from here foo.C:18: error: invalid use of incomplete type ‘struct baz<const char*>’ foo.C:13: error: declaration of ‘struct baz<const char*>’

    Read the article

  • Making a char function parameter const?

    - by Helper Method
    Consider this function declaration: int IndexOf(const char *, char); where char * is a string and char the character to find within the string (returns -1 if the char is not found, otherwise its position). Does it make sense to make the char also const? I always try to use const on pointer parameters but when something is called by value, I normally leave the const away. What are your thoughts?

    Read the article

  • Problem with generics

    - by jess
    I have this code in base class protected virtual bool HasAnyStuff<TObject>(TObject obj) where TObject:class { return false; } In child class I am overriding protected override bool HasAnyStuff<Customer>(Customer obj) { //some stuff if Customer.sth etc return false; } I am getting this error '''Type parameter declaration must be an identifier not a type''' What is it I am doing wrong here?

    Read the article

  • How can I define multiple types with the same name and different type parameters using Reflection Em

    - by wawa
    How can I generate types like these using the System.Reflection.Emit libraries: public class Test<T> {} public class Test<T1, T2> {} When I call ModuleBuilder.DefineType(string) with the second type declaration, I get an exception because there is already another type in the module with the same name (I've already defined the type parameter on the first type). Any ideas?

    Read the article

  • How to pass an object from a Frame to another Frame in a Windows 8 Style App

    - by Mythul
    I have problem that i just cant figure out right now. I am trying to develop a Windows-8 style app and im stuck implementing this functionality. I have a MainWindow which contains a ListBox and a Button (lets say addButton). When i click the button i navigate to a new page, lets say AddCustomerPage with this.Frame.Navigate(typeof (AddCustomerPage)); AddCustomerPage has 1 textBox and 1 button (lets say doneButton. When i click the button i want the string in the textBox to be added to the ListBox on the previous page. This is my current functionality: 1. MainWindow is created. Click addButton AddCustomer page is created. MainWindow is destroyed(problem). Click doneButton A MainWindow object is created with a ListBox with 1 item. Repeat the add process, i always get a MainWindow with a ListBox with 1 item. Thanks for the help. Here is the code: public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); this.brainPageController = new PageController(); // add items from the List<String> to the listBox listGoals.ItemsSource = brainPageController.GetListGoals(); } protected override void OnNavigatedTo(NavigationEventArgs e) { var parameter = e.Parameter as String; // a simple controller that adds a string to a List<string> brainPageController.AddGoal(parameter); } private void addButton_Click(object sender, RoutedEventArgs e) { this.Frame.Navigate(typeof (GoalsInfo)); } // VARIABLES DECLARATION private PageController brainPageController; } public sealed partial class GoalsInfo : WinGoalsWIP.Common.LayoutAwarePage { public GoalsInfo() { this.InitializeComponent(); this.brainPageController = new PageController(); } protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { } protected override void SaveState(Dictionary<String, Object> pageState) { } private void Button_Click_1(object sender, RoutedEventArgs e) { brainPageController.AddGoal(nameTextBox.Text); this.Frame.Navigate(typeof(MainPage), nameTextBox.Text); } // VARIABLES DECLARATION PageController brainPageController; }

    Read the article

  • Passing template into boost function

    - by Ockonal
    template <class EventType> class IEvent; class IEventable; typedef boost::function<void (IEventable&, IEvent&)> behaviorRef; What is the right way for passing template class IEvent into boost function? With this code I get: error: functional cast expression list treated as compound expression error: template argument 1 is invalid error: invalid type in declaration before ‘;’ token

    Read the article

  • Eclipse Style Navigation In VS.Net 2008 IDE

    - by Lennie
    Hi, I'm a Java developer starting with .Net development using VS.Net 2008. I would love to get the Eclipse style of navigating methods etc by pressing the Ctrl key, hover over a method then click it to got to that method's declaration. Does such a plugin exist for VS.Net 2008? thanks

    Read the article

  • Haskell: list of elements with class restriction

    - by user1760586
    here's my question: this works perfectly: type Asdf = [Integer] type ListOfAsdf = [Asdf] Now I want to do the same but with the Integral class restriction: type Asdf2 a = (Integral a) => [a] type ListOfAsdf2 = (Integral a) => [Asdf2 a] I got this error: Illegal polymorphic or qualified type: Asdf2 a Perhaps you intended to use -XImpredicativeTypes In the type synonym declaration for `ListOfAsdf2' I have tried a lot of things but I am still not able to create a type with a class restriction as described above. Thanks in advance!!! =) Dak

    Read the article

  • How should onClick Listener by defined and instantiated for an Activity

    - by Code Droid
    My Activity has multiple lists so I have defined MyClickListener as below: My question is how I should instantiate this class: MyClickListener mMyClickListener = new MyClickListener(); Or maybe it is better to instantiate inside the onCreate(Bundle) and just define above. Whats considered the better way? I don't want too much in onCreate() its already full of stuff. Any thoughts on the declaration and instatiation? Whats the best way? private class MyClickListener implements OnClickListener { @Override public void onClick(View view) { } }

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >