Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Your butt is mine." -- Michael Jackson, Bad


devel / comp.lang.c++ / Re: "Inside STL: The vector" by Raymond Chen

SubjectAuthor
* "Inside STL: The vector" by Raymond ChenLynn McGuire
+- Re: "Inside STL: The vector" by Raymond ChenPavel
`- Re: "Inside STL: The vector" by Raymond Chenwij

1
"Inside STL: The vector" by Raymond Chen

<uah6ja$tvdd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=962&group=comp.lang.c%2B%2B#962

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lynnmcgu...@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.c++
Subject: "Inside STL: The vector" by Raymond Chen
Date: Thu, 3 Aug 2023 16:35:38 -0500
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uah6ja$tvdd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 3 Aug 2023 21:35:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d161ef9ac41a38a0fa283dbab21621db";
logging-data="982445"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194YJZ5WxcNIGoH6Hvn2QfpDQIfLE2kGlo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.1
Cancel-Lock: sha1:fPnf00CIG9hUywK9K51kOncjPpM=
Content-Language: en-US
 by: Lynn McGuire - Thu, 3 Aug 2023 21:35 UTC

"Inside STL: The vector" by Raymond Chen
https://devblogs.microsoft.com/oldnewthing/20230802-00/?p=108524

"The C++ language comes with a standard library, and although
implementations are welcome to implement the library types in whatever
manner they choose, they are constraints imposed by the standard which
often force one of a small number of possible implementations."

"The std::vector is one of those types which is constrained to the point
that there’s really only one viable implementation."

Lynn

Re: "Inside STL: The vector" by Raymond Chen

<59wzM.428946$mPI2.323967@fx15.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=969&group=comp.lang.c%2B%2B#969

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
Subject: Re: "Inside STL: The vector" by Raymond Chen
Newsgroups: comp.lang.c++
References: <uah6ja$tvdd$1@dont-email.me>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
MIME-Version: 1.0
In-Reply-To: <uah6ja$tvdd$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 21
Message-ID: <59wzM.428946$mPI2.323967@fx15.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sat, 05 Aug 2023 18:02:41 UTC
Date: Sat, 5 Aug 2023 14:02:33 -0400
X-Received-Bytes: 1586
 by: Pavel - Sat, 5 Aug 2023 18:02 UTC

Lynn McGuire wrote:
> "Inside STL: The vector" by Raymond Chen
>   https://devblogs.microsoft.com/oldnewthing/20230802-00/?p=108524
>
> "The C++ language comes with a standard library, and although
> implementations are welcome to implement the library types in whatever
> manner they choose, they are constraints imposed by the standard which
> often force one of a small number of possible implementations."
>
> "The std::vector is one of those types which is constrained to the point
> that there’s really only one viable implementation."
This does not sound correct. At least, one can change how the vector
grows, how it stores capacity and size and whether it is a monolithic
class or composed of reusable pieces... decisions, decisions, decisions.

>
> Lynn

-Pavel

Re: "Inside STL: The vector" by Raymond Chen

<16af6b13-33c4-4ada-92eb-b79bba23c6aan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=970&group=comp.lang.c%2B%2B#970

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:a37:93c2:0:b0:762:42b5:8f08 with SMTP id v185-20020a3793c2000000b0076242b58f08mr31979qkd.13.1691440858186;
Mon, 07 Aug 2023 13:40:58 -0700 (PDT)
X-Received: by 2002:a05:6870:d896:b0:1be:ff88:2737 with SMTP id
dv22-20020a056870d89600b001beff882737mr12741703oab.8.1691440857693; Mon, 07
Aug 2023 13:40:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c++
Date: Mon, 7 Aug 2023 13:40:57 -0700 (PDT)
In-Reply-To: <uah6ja$tvdd$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=124.218.76.41; posting-account=0Ek0TQoAAAAS0oceh95IuNV59QuIWNeN
NNTP-Posting-Host: 124.218.76.41
References: <uah6ja$tvdd$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <16af6b13-33c4-4ada-92eb-b79bba23c6aan@googlegroups.com>
Subject: Re: "Inside STL: The vector" by Raymond Chen
From: wynii...@gmail.com (wij)
Injection-Date: Mon, 07 Aug 2023 20:40:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4360
 by: wij - Mon, 7 Aug 2023 20:40 UTC

On Friday, August 4, 2023 at 5:35:57 AM UTC+8, Lynn McGuire wrote:
> "Inside STL: The vector" by Raymond Chen
> https://devblogs.microsoft.com/oldnewthing/20230802-00/?p=108524
>
> "The C++ language comes with a standard library, and although
> implementations are welcome to implement the library types in whatever
> manner they choose, they are constraints imposed by the standard which
> often force one of a small number of possible implementations."
>
> "The std::vector is one of those types which is constrained to the point
> that there’s really only one viable implementation."
>
> Lynn

The problem with std::vector is that the role is not clear.
Impl. aside, libwy https://sourceforge.net/projects/cscall/files/latest/download
clearly defines Array<T> as a wrapper of malloc(2) or the like.

This is lastly added example a_sysinfo.cpp (collect and dump system information)

#include <Wy.stdio.h>
#include <Wy.unistd.h>
#include <Wy.time.h>
#include <sys/utsname.h>
using namespace Wy;
String getfile(const char* fname)
{ Errno r;
String str;

cout << "---------------- Dump file: " << fname << " -----------------" WY_ENDL;
if((r=Wy::access(fname,F_OK))!=Ok) { // showcase, this check is not necessary
return "File (" + String(fname) + ") reading error: " + wrd(r) + WY_ENDL;
}
RegFile regf(fname,O_RDONLY); // may be virtual files (file size=0),
RdBuf strm(regf); // get_whole_regfile(..) won't work
for(;strm.is_eof()==false;) {
if((r=strm.append_read(str))!=Ok) {
WY_THROW(r);
}
if(str.size()>1000000) {
WY_THROW( Errno(EFBIG) ); // file size > 1-mega bytes
}
}
return str;
};
void dump_sysinfo() {
Errno r;
String str;

cout << "hostname: " << Wy::gethostname() << WY_ENDL;
{
struct utsname buf;
if(::uname(&buf)!=0) {
WY_THROW( Errno(errno) );
}
cout << WY_ENDL;
cout << "---------------- Dump struct utsname -----------------" WY_ENDL;
cout << "sysname : " << buf.sysname << WY_ENDL;
cout << "nodename: " << buf.nodename << WY_ENDL;
cout << "release : " << buf.release << WY_ENDL;
cout << "version : " << buf.version << WY_ENDL;
cout << "machine : " << buf.machine << WY_ENDL;
}

cout << WY_ENDL;
cout << "ttyname(cerr): " << ttyname(cerr) << WY_ENDL;
cout << "ttyname(cin): " << ttyname(cin) << WY_ENDL;
cout << "ttyname(cout): " << ttyname(cout) << WY_ENDL;
cout << "ctermid(): " << ctermid() << WY_ENDL;
cout << WY_ENDL;
cout << "timezone: " << local_tzname() << WY_ENDL;
cout << WY_ENDL;
cout << "current working directory: " << getcwd() << WY_ENDL;

cout << WY_ENDL;
cout << getfile("/etc/os-release");
cout << WY_ENDL;
cout << getfile("/proc/cpuinfo");
cout << WY_ENDL;
cout << getfile("/proc/version");
cout << WY_ENDL;
cout << getfile("/proc/meminfo");
cout << WY_ENDL;
};

int main(int argc, const char* argv[])
try {
dump_sysinfo();
return 0;
} catch(const Errno& e) {
cerr << wrd(e) << WY_ENDL;
return e.c_errno();
} catch(...) {
cerr << "main() caught(...)" WY_ENDL;
throw;
};


devel / comp.lang.c++ / Re: "Inside STL: The vector" by Raymond Chen

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor