Byl vydán Debian Installer Trixie RC 2, tj. druhá RC verze instalátoru Debianu 13 s kódovým názvem Trixie.
Na čem pracují vývojáři webového prohlížeče Ladybird (GitHub)? Byl publikován přehled vývoje za červen (YouTube).
Libreboot (Wikipedie) – svobodný firmware nahrazující proprietární BIOSy, distribuce Corebootu s pravidly pro proprietární bloby – byl vydán ve verzi 25.06 "Luminous Lemon". Přidána byla podpora desek Acer Q45T-AM a Dell Precision T1700 SFF a MT. Současně byl ve verzi 25.06 "Onerous Olive" vydán také Canoeboot, tj. fork Librebootu s ještě přísnějšími pravidly.
Licence GNU GPLv3 o víkendu oslavila 18 let. Oficiálně vyšla 29. června 2007. Při té příležitosti Richard E. Fontana a Bradley M. Kuhn restartovali, oživili a znovu spustili projekt Copyleft-Next s cílem prodiskutovat a navrhnout novou licenci.
Svobodný nemocniční informační systém GNU Health Hospital Information System (HIS) (Wikipedie) byl vydán ve verzi 5.0 (Mastodon).
Open source mapová a navigační aplikace OsmAnd (OpenStreetMap Automated Navigation Directions, Wikipedie, GitHub) oslavila 15 let.
Vývojář Spytihněv, autor počítačové hry Hrot (Wikipedie, ProtonDB), pracuje na nové hře Brno Transit. Jedná se o příběhový psychologický horor o strojvedoucím v zácviku, uvězněném v nejzatuchlejším metru východně od všeho, na čem záleží. Vydání je plánováno na čtvrté čtvrtletí letošního roku.
V uplynulých dnech byla v depu Českých drah v Brně-Maloměřicích úspěšně dokončena zástavba speciální antény satelitního internetu Starlink od společnosti SpaceX do jednotky InterPanter 660 004 Českých drah. Zástavbu provedla Škoda Group. Cestující se s InterPanterem, vybaveným vysokorychlostním satelitním internetem, setkají například na linkách Svitava Brno – Česká Třebová – Praha nebo Moravan Brno – Břeclav – Přerov – Olomouc.
Byla vydána nová verze 8.7.0 správce sbírky fotografií digiKam (Wikipedie). Přehled novinek i s náhledy v oficiálním oznámení (NEWS). Nejnovější digiKam je ke stažení také jako balíček ve formátu AppImage. Stačí jej stáhnout, nastavit právo ke spuštění a spustit.
Před 30 lety, k 1. 7. 1995, byl v ČR liberalizován Internet - tehdejší Eurotel přišel o svou exkluzivitu a mohli začít vznikat první komerční poskytovatelé přístupu k Internetu [𝕏].
Ne, není. Zkuste si toto
#define DIR_SLASH L'/' template<typename T> class BaseString{ protected: public: unsigned length() const { return 0; } T& operator[]( unsigned int pos ); const T& operator[]( unsigned int pos ) const; // V tomhle bude problém operator T*(); operator const T*() const; }; typedef BaseString<wchar_t> wstr; bool isslash(const wstr& pathW) { return ( pathW.length() == 1 && pathW[0] == DIR_SLASH ); }
uložit do souboru a přeložit (nelinkovat). Mé gcc ani nepípne, dokonce ani s -Wall
Problém je tedy někde jinde než v tom, co jste nám ukázal.
$ g++ -c -Wall test.cpp test.cpp: In function ‘bool isslash(const wstr&)’: test.cpp:20: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:9: note: candidate 1: const T& BaseString<T>::operator[](unsigned int) const [with T = wchar_t] test.cpp:20: note: candidate 2: operator[](const wchar_t*, int) <built-in> test.cpp:20: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:9: note: candidate 1: const T& BaseString<T>::operator[](unsigned int) const [with T = wchar_t] test.cpp:20: note: candidate 2: operator[](const wchar_t*, int) <built-in>
0L
', pak by to mohlo přesně odpovídat deklaraci.
imho, co tam ten operator pretypovania (a dokonca const) na pointer robi? Kandiduje na uchylku roku?
Zase se prostě rozhodl, že je možné přetypovat BaseString<wchar_t> na wchar_t*, tak hned začal dělat chytrého a cpe mi to. Já se ho ale neprosil
#include <wchar.h> #include <memory> class WideString{ protected: wchar_t* buffer; public: WideString( const wchar_t *text ) { buffer = wcsdup(text); } ~WideString() { free(buffer); } wchar_t& operator[](unsigned int pos) { return buffer[pos]; } const wchar_t& operator[](unsigned int pos) const { return buffer[pos]; } operator wchar_t*() { return buffer; } operator const wchar_t*() const { return buffer; } }; int main( int argc, char **argv ) { WideString str( L"TESTIK" ); if( str[0] == L'T' ) str[0] = L't'; return 0; }
[mikos@tauri temp]$ g++ -c -Wall test.cpp test.cpp: In function ‘int main(int, char**)’: test.cpp:41: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:17: note: candidate 1: wchar_t& WideString::operator[](unsigned int) test.cpp:41: note: candidate 2: operator[](wchar_t*, int) <built-in> test.cpp:41: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:17: note: candidate 1: wchar_t& WideString::operator[](unsigned int) test.cpp:41: note: candidate 2: operator[](wchar_t*, int) <built-in> test.cpp:41: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:17: note: candidate 1: wchar_t& WideString::operator[](unsigned int) test.cpp:41: note: candidate 2: operator[](wchar_t*, int) <built-in> test.cpp:41: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: test.cpp:17: note: candidate 1: wchar_t& WideString::operator[](unsigned int) test.cpp:41: note: candidate 2: operator[](wchar_t*, int) <built-in>A jen pro zajímavost GCC 3.3.6:
[mikos@tauri temp]$ g++3 -c -Wall test.cpp test.cpp: In function `int main(int, char**)': test.cpp:41: error: ISO C++ says that `wchar_t& WideString::operator[](unsigned int)' and `operator[]' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter test.cpp:41: error: ISO C++ says that `wchar_t& WideString::operator[](unsigned int)' and `operator[]' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter test.cpp:41: error: ISO C++ says that `wchar_t& WideString::operator[](unsigned int)' and `operator[]' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter test.cpp:41: error: ISO C++ says that `wchar_t& WideString::operator[](unsigned int)' and `operator[]' are ambiguous even though the worst conversion for the former is better than the worst conversion for the latter
Nicméně je opravdu velmi zvláštní, že vám to prošlo bez problémů...Vidím to na architekturu...
sizeof(int) != sizeof(long)
0U
' (nebo operátor []
deklaruje jako int
), projde to i s -m32
.
int main( int argc, char **argv ) { WideString str( L"TESTIK" ); free(str); return 0; }
s/Mně/Mě/g
, 2. a 4. pár = mě, 3. a 6. pád = mně.
s/Popraveno/Opraveno/g
.
wchar_t
není schopen pokrýt potřebný rozsah znaků?
To není špatný předpoklad, protože je to předpoklad, vycházející ze specifikace jazyků C
3.7.3 wide character
bit representation that fits in an object of type wchar_t
, capable of representing any
character in the current locale
a C++
3.9.1.5 Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largest extended character set specified among the supported locales (22.1.1).
Takže trvám na tom, že je-li něco špatně, je to implementace widestringů ve Windows (vypadá-li tak, jak tvrdíte). Kdyby totiž měl být wchar_t
16-bitový typ a widestringy by měly být v UTF-16, nemělo by smysl je vůbec zavádět, protože by proti klasickým stringům v UTF-8 naprosto nic nepřinášely.
wchar_t
je datový typ, který pokrývá celý rozsah znakové sady používaného locale, takže jeden wchar_t
podle specifikace jazyka odpovídá jednomu znaku (to je také důvod, proč byly vůbec wchar_t
a widestring zaveden). Tak je ten typ definován a tak má fungovat. Pokud tak někde nefunguje, není to korektní implementace ISO C resp. ISO C++.
#include <stdio.h> #include <wchar.h> int main(int arg, char* argv[]) { printf("%u\n", sizeof(wchar_t)); return 0; }výstup:
2kompilováno ve win, pod gcc i ve visual studiu, ahoja
Jestli má frčet aplikace jen pod linuxem, není co řešit.Správně jste měl říct: "Jestli má frčet aplikace pod jakýmkoliv rozumným operačním systémem, není co řešit."
wchar_t
specifikaci sám o sobě neodporuje. Pokud pokryje celý rozsah použité znakové sady a pokud jeden widechar bude jeden znak, je to v pořádku. Chybou je, pokud bude jeden znak zapisován více widechary, tj. začne se zavádět nějaký "multi-widechar string", který v sobě spojí nevýhody MBS a WCS.
wchar_t
a WCS zaveden, je to, aby bylo možné opět interně pracovat s reprezentací řetězců, kde jedna položka pole odpovídá jednomu znaku. Implementace, kde je jeden znak popsán více widechary, odporuje jednak specifikaci, jednak zdravému rozumu a do třetice je úplně k ničemu.
Tiskni
Sdílej: