Namespaces
Variants
Actions

Talk:cpp/23

From cppreference.com

I think the literal suffix for size_t is easy to realize.

#include<iostream>
#include<array>
#include<cstdlib>
 
using namespace std;
inline size_t operator ""zu(unsigned long long n){return n;}
inline ssize_t operator ""sz(unsigned long long n){return n;}
 
int main(){
 srand(20210120);
 array<int,13>ar{1,2,3,4,5,6,7,6,5,4,2,5,2};
 for(auto i=0zu;i<100zu;i+=rand()%2) {cout<<ar[i]<<' ';}
}

But the one I should say is:now,the compiler doesn't support operator ""sz(signed long long n) for argument list. JK19 (talk) 05:50, 20 January 2021 (PST)

This is a pure core language feature, which means no code in headers/source files of the implementation of the standard library is needed. --Fruderica (talk) 23:11, 20 January 2021 (PST)