🌐
Merriam-Webster
merriam-webster.com › thesaurus › empty
EMPTY Synonyms: 314 Similar and Opposite Words | Merriam-Webster Thesaurus
2 weeks ago - Synonyms for EMPTY: devoid, barren, vacant, blank, void, vacuous, clean, emptied; Antonyms of EMPTY: full, complete, provided, filled, replete, occupied, furnished, supplied
🌐
Thesaurus.com
thesaurus.com › browse › empty
EMPTY Synonyms & Antonyms - 219 words | Thesaurus.com
Find 219 different ways to say EMPTY, along with antonyms, related words, and example sentences at Thesaurus.com.
People also ask

How does the adjective 'empty' contrast with its synonyms?

Some common synonyms of empty are blank, vacant, vacuous, and void. While all these words mean "lacking contents which could or should be present," empty suggests a complete absence of contents.

// an empty bucket

🌐
merriam-webster.com
merriam-webster.com › thesaurus › empty
EMPTY Synonyms: 314 Similar and Opposite Words | Merriam-Webster ...
When could 'vacant' be used to replace 'empty'?

The words vacant and empty are synonyms, but do differ in nuance. Specifically, vacant suggests an absence of appropriate contents or occupants.

// a vacant apartment

🌐
merriam-webster.com
merriam-webster.com › thesaurus › empty
EMPTY Synonyms: 314 Similar and Opposite Words | Merriam-Webster ...
When is 'vacuous' a more appropriate choice than 'empty'?

Although the words vacuous and empty have much in common, vacuous suggests the emptiness of a vacuum and especially the lack of intelligence or significance.

// a vacuous facial expression

🌐
merriam-webster.com
merriam-webster.com › thesaurus › empty
EMPTY Synonyms: 314 Similar and Opposite Words | Merriam-Webster ...
🌐
WordHippo
wordhippo.com › what-is › the-opposite-of › empty.html
What is the opposite of empty?
Antonyms for empty include filled, loaded, stuffed, chockful, crammed, cramped, crowded, packed, stacked and stocked. Find more opposite words at wordhippo.com!
🌐
Power Thesaurus
powerthesaurus.org › empty › antonyms
EMPTY Antonyms: 1 537 Opposite Words & Phrases
Discover 1 537 antonyms of Empty to express ideas with clarity and contrast.
🌐
Cambridge Dictionary
dictionary.cambridge.org › us › thesaurus › empty
EMPTY - 81 Synonyms and Antonyms - Cambridge English
1 month ago - I heard laughter, but the room was empty. ... It was three o'clock in the morning and the streets were deserted. ... After the famine, the area was seriously depopulated. ... The island is uninhabited. ... The apartment is currently unoccupied. ... The house stood in a bleak, desolate landscape. ... The room was completely bare. ... The house was unfurnished. ... The hospital has no vacant beds. ... Sign your name in the blank space at the bottom of the form.
🌐
Promova
promova.com › antonyms-of › empty
What is the opposite of empty? | Antonyms empty | Promova
This term directly contrasts with 'empty' by indicating that a space or container has no available capacity because it is already completely occupied or filled. Yes, 'crowded' can be considered an antonym of 'empty' in contexts where it's used to describe a space filled with people or items, ...
🌐
English Grammar Here
englishgrammarhere.com › home › opposite of empty, antonyms of empty, meaning and example sentences
Opposite Of Empty, Antonyms of Empty, Meaning and Example Sentences - English Grammar Here
January 17, 2021 - In a language, not every word has a synonym, but not every word has an opposite. In general, adjectives and adverbs have opposite meanings, that is, words reporting quality and quantity often have opposite words. Empty means; containing nothing; not filled or occupied, blank, free, leisure, null
🌐
English Study Here
englishstudyhere.com › home › opposite of empty, antonym of empty, 21 opposite words for empty
Opposite of Empty, Antonym of Empty, 21 Opposite Words For Empty - English Study Here
January 17, 2022 - Opposite of Empty, Antonym of Empty, 21 Opposite Words For Empty Meaning; Remove all the contents of (a container) Opposites of Empty spacious full plummy extensive wide satiate deep whole broad exact occupied rotund fraught complete replete just loaded satiated precise large filled Synonym for Empty blank free idle leisure null hungry ravenous unfed hollow greedy for devoid of bereft destitute shorn void of meaningless pointless senseless insignificant frivolous trivial unimportant negligible immaterial in vain useless frantic unavailing needless Example Sentences Your account is empty.
Find elsewhere
🌐
Antonym.com
antonym.com › empty
Opposite word for EMPTY > Synonyms & Antonyms
empty (English) emty (Middle English (1100-1500)) æmtig (Old English (ca. 450-1100)) adjective. ['ˈɛmpti, ˈɛmti'] devoid of significance or point. meaningful · indistinct · unclearness · unclear · ambiguous · nonmeaningful · hollow · vacuous · empty (English) emty (Middle English (1100-1500)) æmtig (Old English (ca.
🌐
EngDic
engdic.org › home › vocabulary › opposite/antonyms › opposite of empty, antonyms of empty (example sentences)
Opposite of Empty, Antonyms of Empty (Example Sentences) - EngDic
June 22, 2023 - Type: Adjective/Verb Meaning/Definition ... Other Opposites of Empty Here is the list of all opposites or antonyms of empty: Loaded Furnished Topped up ......
🌐
Synonyms.com
synonyms.com › antonyms › Empty
Antonym of Empty
That is empty which contains nothing; that is vacant which is without that which has filled or might be expected to fill it; vacant has extensive reference to rights or possibilities of occupancy. A vacant room may not be empty, and an empty house may not be vacant.
🌐
Thesaurus.plus
thesaurus.plus › antonyms › empty
More 160 Empty Antonyms. Full list of opposite words of empty.
More 160 Empty antonyms. What are opposite words of Empty? Full, fill, filled, meaningful. Full list of antonyms for Empty is here.
🌐
YourDictionary
thesaurus.yourdictionary.com › home › empty
Empty Synonyms: 182 Synonyms and Antonyms for Empty | YourDictionary.com
Synonyms for EMPTY: blank, vacant, void, vacuous, bare, clear, dog-hungry, blank, vacuous, hollow, vacant; Antonyms for EMPTY: full, filled, sated, satisfied, replete, complete, entire, full, effective, filled, fruitful.
🌐
Quora
quora.com › Is-there-a-concise-opposite-of-is-empty
Is there a concise opposite of “is empty”? - Quora
Answer (1 of 3): Hello Ankit Singh. I’m going to go with ‘no’, as a container has three states: completely empty, completely full, and partially filled (which is neither completely full nor completely empty). If you consider the qualities of ‘emptiness’ and ‘fullness’, there can ...
Top answer
1 of 14
30

In most cases you can reverse the order of the ifand the else to clean up the code:

const std::string fmtTime(const std::string& start, const std::string& end)
{
    std::string time;
    if (start.empty() && end.empty()) {
        return time;
    }

    if (start.empty() || end.empty()) {
        if (end.empty()) {
            time = "since "+start;
        } else {
            time = "until "+end;
        }
    } else {
        time = "from "+start+" to "+end;
    }
    return time;
}

Or even cleaner after some more refactoring:

std::string fmtTime(const std::string& start, const std::string& end)
{
    if (start.empty() && end.empty()) {
        return std::string();
    }

    if (start.empty()) {
        return "until "+end;
    }    

    if (end.empty()) {
        return "since "+start;
    }

    return "from "+start+" to "+end;
}

And for the ultimate compactness (although I prefer the previous version, for its readability):

std::string fmtTime(const std::string& start, const std::string& end)
{
    return start.empty() && end.empty() ? std::string()
         : start.empty()                ? "until "+end
         :                  end.empty() ? "since "+start
                                        : "from "+start+" to "+end;
}

Another possibility is to create a helper function:

inline bool non_empty(const std::string &str) {
  return !str.empty();
}

if (non_empty(start) || non_empty(end)) {
...
}
2 of 14
12

I think I'd eliminate the conditions in favor of a little math:

const std::string fmtTime(const std::string& start, const std::string& end) {

    typedef std::string const &s;

    static const std::function<std::string(s, s)> f[] = {
        { return "from " + a + " to " + b; }           
        { return "since " + a; },
        { return "until " + b; },
        { return ""; },
    };

   return fstart.empty() * 2 + end.empty();
}

Edit: if you prefer, you can express the math as start.empty() * 2 + end.empty(). To understand what's going on, perhaps it's best if I expound on how I thought of things to start with. I thought of things as a 2D array:

(Feel free to swap the "start empty" and "end empty", depending on whether you prefer to think in row-major or column-major order).

The start.empty() and end.empty() (or the logical not of them, if you prefer) each act as as an index along one dimension of this 2D matrix. The math involved simply "linearizes" that addressing, so instead of two rows and two columns, we get one long row, something like this:

In mathematical terms, that's a simple matter of "row * columns + column" (or, again, vice versa, depending on whether you prefer row-major or column-major ordering). I originally expressed the * 2 part as a bit-shift and the addition as a bit-wise or (knowing the least significant bit is empty, because of the previous left-shift). I find that easy to deal with, but I guess I can understand where others might not.

I should probably add: although I've already mentioned row-major vs. column-major, it should be fairly obvious that the mapping from the two "x.empty" values to positions in the array is basically arbitrary. The value we get from .empty() means that we get a 0 when the value is not present, and a 1 when it is. As such, a direct mapping from the original values to the array positions is probably like this:

Since we're linearizing the value we have a few choices for how we do the mapping:

  1. simply arrange the array to suit the values as we get them.
  2. invert the value for each dimension individually (this is basically what led to the original question--the constant use of !x.empty())
  3. Combine the two inputs into a single linear address, then "invert" by subtracting from 3.

For those who doubt the efficiency of this, it actually compiles down to this (with VC++):

mov eax, ebx
cmp QWORD PTR [rsi+16], rax
sete    al
cmp QWORD PTR [rdi+16], 0
sete    bl
lea eax, DWORD PTR [rbx+rax*2]
movsxd  rcx, eax
shl rcx, 5
add rcx, r14
mov r9, rdi
mov r8, rsi
mov rdx, rbp
call    <ridiculously long name>::operator()

Even the one-time construction for f isn't nearly as bad as some might think. It doesn't involve dynamic allocation, or anything on that order. The names are long enough that it looks a little scary initially, but in the end, it's mostly four repetitions of:

lea rax, OFFSET FLAT:??_7?$_Func_impl@U?$_Callable_obj@V<lambda_f466b26476f0b59760fb8bb0cc43dfaf>@@$0A@@std@@V?$allocator@V?$_Func_class@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@AEBV12@@std@@@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@AEBV42@AEBV42@@std@@6B@
mov QWORD PTR f$[rsp], rax

Leaving out the static const doesn't really seem to affect execution speed much. Since the table is static, I think it should be there, but as far as execution speed goes, it's not the kind of massive win we might expect if the table initialization involved four separate dynamic allocations, or anything like that.

🌐
OneLook
onelook.com
"empty" synonyms, related words, and opposites - OneLook
vacuous, meaningless, lifeless, void, vacant, unfilled, blank, clean, empty-handed, bare, more... Opposite: full, occupied, loaded, abundant, replete · Types: vacant, barren, hollow, desolate, unoccupied, blank, void, bare, more...
🌐
Bab.la
en.bab.la › synonyms › english › empty
EMPTY - Synonyms and antonyms - bab.la
In the sense of his face was grey and his eyes were emptySynonyms blank • expressionless • vacant • deadpan • wooden • stony • impassive • inanimate • vacuous • absent • glazed • fixed • lifeless • emotionless • unresponsive • inscrutableOpposite expressive
🌐
Synonym.com
synonym.com › synonyms › empty
Another word for EMPTY > Synonyms & Antonyms
1. An empty canvas is full. - Robert Rauschenberg 2. I used to stay up all night playing 'Resident Evil 2,' and it wouldn't stop until the sun came up. Then I'd walk outside at dawn's first light, looking at the empty streets of London, and it was like life imitating art.