dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Raj90

Search: Search took 0.00 seconds.

  1. Thread: Templates

    by Raj90
    Replies
    8
    Views
    762

    Re: Templates

    How can we add parameterised Constructor to the Structure, for Example:



    MyClass
    {
    };
    struct Mystruct
    {
    int val1;
  2. Thread: Templates

    by Raj90
    Replies
    8
    Views
    762

    Re: Templates

    There is no compiling issues with the code.. as i tried before posting.

    straight forward query.
    Myclass<10,Mystruct> myObj();--> what should i pass as argument ,if i want to access the structure?
  3. Thread: Templates

    by Raj90
    Replies
    8
    Views
    762

    Re: Templates

    Ya i got your point.but if i have the following code then how to access the following functions



    template<int size,class T>
    class MyClass {
    public:
    MyClass(const T...
  4. Thread: Templates

    by Raj90
    Replies
    8
    Views
    762

    Templates

    template<int,class T>
    class MyClass {
    public:
    T buff[10];
    T TestFunction(T val) {return buff[val];}
    };

    int main()
    {
    struct Mystruct {
  5. Replies
    13
    Views
    1,194

    Re: [] Operator Overloading in C++

    T is template , type typename which supports all data types... I tested with all types. but when i have to return the value when the queue is empty,as of now i am returning T{} which is static , but...
  6. Replies
    13
    Views
    1,194

    Re: [] Operator Overloading in C++

    In case of functions returning a reference we need to return a reference to something which exists after function returns - otherwise it might crash. You used statics which keep existing after...
  7. Replies
    13
    Views
    1,194

    Re: [] Operator Overloading in C++

    It should check that condition-- Array out of bounds?
    My test case is failing if i won't check that condition
  8. Replies
    13
    Views
    1,194

    Re: [] Operator Overloading in C++

    static T empty {};? Why we use static? How can we solve without using statics?
  9. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    I understood the possibilities... but those possibilities are not matching with my POP() method.
  10. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    Return type of method should not change it should return T type and it should not pass any arguments?

    With this requirement is there any idea for the above issue?
  11. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    T pop()
    {
    if (isEmpty())
    {
    return T{};
    }

    size -= 1;

    int index = tail;
  12. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    Can you please provide me the code snippet for this?
  13. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    I can't raise an exception, because we don't use them

    return nullopt--> this is only used in c++17,as we are using c++11?

    Is there any other way to solve?
  14. Replies
    24
    Views
    1,181

    Re: Circular Buffer POP()

    Is there any other method other that returning T{}?
  15. Replies
    13
    Views
    1,194

    Re: [] Operator Overloading in C++

    Hi Victor,

    I have the method called get()



    const T &get(uint16_t index) const
    {
    if (index >= size_ || index < 0)//if array out of bound
    {
  16. Replies
    13
    Views
    1,194

    [] Operator Overloading in C++

    Hi,

    I implemented one method for getting an element at given position.

    But I need the logic for the same method Wrapping with the [] operator, and Please help me how to call that particular...
  17. Replies
    24
    Views
    1,181

    Circular Buffer POP()

    Hi,

    I have Circular buffer with POP() method,

    If the buffer is empty then i will return 0,but when i try to use buffer with other object which is not convertible to zero then it will fail to...
Results 1 to 17 of 20


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)