Project

General

Profile

Feature #663

Document tipps and tricks

Added by Maximilian Seesslen 5 months ago. Updated 3 months ago.

Status:
Neu
Priority:
Normal
Target version:
-
Start date:
07/04/2025
Due date:
% Done:

0%

Estimated time:
CS Zielversion:

Description

#include <stdio.h>

class C1
{
    int i1;
    public:
        constexpr 
        //consteval
        C1(int _i1)
            :i1(_i1)
        {
            printf("Init!\n");
        };
        void print() const
        {
            printf("Value: %d\n", i1);
        }
};

// const constexpr C1 c_c1{20};
// const C1 c_c1{20};

int main(int argc, const char* argv[])
{
   C1 c_c1{20};
   c_c1.print();
   return(0);
};

constexpr: optinally, compiler can decide
consteval: Force it!

History

#1

Updated by Maximilian Seesslen 3 months ago

  • Subject changed from ducoment tipps and tricks to Document tipps and tricks
  • Assignee set to Maximilian Seesslen

Also available in: Atom PDF