Search:

Type: Posts; User: Nwb

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    1,286

    Lag does Lag

    Lag does Lag
  2. Replies
    17
    Views
    1,286

    Yes I saw that the text is formatted. But how...

    Yes I saw that the text is formatted. But how does he copy the formatting as well?
    I use Visual Studio too.
  3. Replies
    17
    Views
    1,286

    Can you copy from Visual Studio with the color...

    Can you copy from Visual Studio with the color though? I thought you could only copy text. How might OP have done that? Weird..?

    Tim I'm referring to OP's original topic post, do you notice that...
  4. Replies
    17
    Views
    1,286

    How were you able to color your code in that way?

    How were you able to color your code in that way?
  5. Replies
    12
    Views
    795

    #include struct Foo { ...

    #include <iostream>

    struct Foo {

    std::ostream& operator << (int) {
    return std::cout;
    }
    };

    int main() {
  6. Replies
    12
    Views
    795

    #include void print(bool) { ...

    #include <iostream>

    void print(bool) {
    std::cout << "called";
    }

    class Foo {
    public:

    operator bool() const {
  7. Replies
    12
    Views
    795

    Okay it gives me a compiling error, sorry my bad....

    Okay it gives me a compiling error, sorry my bad.

    Back to this:

    Foo var;
    int val{ var };
    Suppose we have an operator

    operator bool() const {
    return true;
  8. Replies
    12
    Views
    795

    Here: Foo var; bool val{ var }; The...

    Here:

    Foo var;
    bool val{ var };
    The compiler will convert var to type bool implicitly. But the compiler is only supposed to look for implicit conversions when '=' is used right.. so only...
  9. Replies
    12
    Views
    795

    Oh okay so something like int var = Foo(5); would...

    Oh okay so something like int var = Foo(5); would be an implicit conversion from Foo to int (if int opeartor is defined, and not explicit). Whereas inside a conditional is considered as explicit...
  10. Replies
    12
    Views
    795

    Why do we use the keyword 'explicit'? Also can we...

    Why do we use the keyword 'explicit'? Also can we define this operator for user-defined types too like 'explicit operator Matrix()' or is it just for primitive types?
    So when inside a conditional an...
  11. Replies
    12
    Views
    795

    How does std::cin return a bool value?

    How does std::cin return a bool value?
    For instance you can write
    if(std::cin) { ... } to check the fail state of std::cin. But how does that work, if std::cin is an object of istream?

    Also...
  12. Replies
    4
    Views
    524

    How do I implement copy assignment in terms of...

    How do I implement copy assignment in terms of constructor and destructor??
    std::swap interchanges the values.. I don't want to change the argument linked list.

    And by the way would calling the...
  13. How do I separate function definitions from a template class to .cpp file?

    I have a templated class. I want to put the definitions of its functions in a .cpp file, how do I do this?
  14. Replies
    4
    Views
    524

    Btw here's the new operator= I wrote ...

    Btw here's the new operator= I wrote

    Linked_list& Linked_list::operator= (const Linked_list& list) {

    if (list_length == list.list_length) {

    Node* other_node = list.head;
    ...
  15. Replies
    4
    Views
    524

    Is it okay to call the destructor like this?

    Linked_list& Linked_list::operator= (const Linked_list& list) {

    Linked_list::~Linked_list();
    Node* node = new Node, *temp = list.head->next;

    while (temp != nullptr) {
    node...
  16. Couldn't edit that reply. When a variable is...

    Couldn't edit that reply.

    When a variable is declared without the register keyword, could it be stored in the register? I know that static variables could be stored on cache, but cache is not the...
  17. Can I take function names as arguments without using templates?

    STL supposedly does this for functors right, algorithms use identifiers of functions/lambda expressions that return a boolean and get passed two arguments.

    I want to do something similar.
    I...
  18. Registers or cache?

    Registers or cache?
  19. But usually where are they stored? What about...

    But usually where are they stored? What about 'string literals', they're technically lvalues right, so where are they stored?
  20. By the way why is double used over float for...

    By the way why is double used over float for literals with floating point (unless explicitly mentioned to be double)?
    With integer, if the integer literal is longer than int, it would take the type...
  21. By the way.. how is this function call not...

    By the way.. how is this function call not ambiguous?

    #include <iostream>

    void print(int) {
    std::cout << "Int\n";
    }

    void print(long long int) {
    std::cout << "Long\n";
  22. What about mac os

    What about mac os
  23. Are there platform specific headers other than

    There ought to be right? I couldn't find anything proper.
    Is there a site with like a list or something?

    I'm talking about headers that aren't cross-platform yet which are available in compilers...
  24. I didn't understand a word. But are you talking...

    I didn't understand a word. But are you talking about having a class with static member?
  25. I wanted to know if global variables who get...

    I wanted to know if global variables who get values at run-time, once, can become const after getting their values. Thx anyways. Somebody needs to propose run-time constness.
Results 1 to 25 of 201
Page 1 of 9 1 2 3 4